How to hide columns with null value during Cumulative Sum expression in a visualization.

How to hide columns with null value during Cumulative Sum expression in a visualization.

book

Article ID: KB0075646

calendar_today

Updated On:

Products Versions
Spotfire Analyst All versions

Description

If you want to hide the null values in the visualization while selecting the Cumulative sum aggregation for a specific column without affecting the other columns in the visualization on the Y-axis, then you can use the mention custom expression on the Y-Axis.

Example: Since there are null values for the months October, November, December in the data, so while doing Cumulative Sum for all months, instead of showing the same value as of September for the rest, we can just hide them by using the bellow expression without affecting the other selected column on the Y-Axis. 

I have attached a sample analysis file to represent the same scenario named: HideBars.dxp  

Issue/Introduction

To hide only the null values in a Combination Chart while doing cumulative Sum

Environment

All Supported OS

Resolution

You can make use of the following expression in the respective Y-Axis custom expression field:

 Example:  Avg(case  when [Column Name(X)] is null THEN 0 else Sum([Column Name(X)]) OVER (AllPrevious([Axis.X])) end)

Note: Where the  [Column Name(X)]  represents a valid column name as per your data.

Attachments

How to hide columns with null value during Cumulative Sum expression in a visualization. get_app