Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Help with Set analysis

Hi,

My requirement is to get records of previous year when a particulat year is selected .

Sum of Sales

For the same,  I have written the following code

sum({<CurrYear={$(=CurrYear-1)} >}Sales).

So if Curryear is selected as 2015 then i should sum up 2014 records. The formula is working fine when a particular year is selected.

BUt I have a chart where my Curryear is the dimension and my above formula is failing and returning 0.

Chart is Bar chart and the dimension is Curryear (2013,2014,2015, etc). For all years it is showing as 0

Can any one help on this problem? I think we need to change the set analysis, CurrYear = ???

BR,

Neehu

1 Solution

Accepted Solutions
Gysbert_Wassenaar

The set of a set analysis expression is calculated at the chart level, not at the row level. That's why your expression doesn't work with Curryear as dimension unless you select only one value in the Curryear dimension. You can try one of the approaches described in this document: Calculating rolling n-period totals, averages or other aggregations


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

The set of a set analysis expression is calculated at the chart level, not at the row level. That's why your expression doesn't work with Curryear as dimension unless you select only one value in the Curryear dimension. You can try one of the approaches described in this document: Calculating rolling n-period totals, averages or other aggregations


talk is cheap, supply exceeds demand
jonathandienst
Partner - Champion III
Partner - Champion III

You cannot use a set expression like that. The set expression is calculated once for the chart/table and has no knowledge of the dimension values.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein