Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Previous Year Problem

Hi,

i attached a file. Here you can see Chart 1 and Chart 2. In Chart 1 i have the correct result for Current Year and Previous Year (values for 2013 are the same for 2014 plus a zero). In chart 2 when i add the same set analysis present in Chart 1({$<Data = {$(=Only(Data)-1)}>}) i've a bad result for the Previous year...

Thx

3 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Add the set modifier to the inner aggregation function too.

=sum({$<Data = {$(=Only(Data)-1)}>} if(aggr(nodistinct count({$<Data = {$(=Only(Data)-1)}>}distinct if(isnull(CANC_Ar) AND isnull(CANC_Tr),$(=GetFieldSelections(_VariabileProdotto)))),NumScontrino)>=GetPossibleCount($(=GetFieldSelections(_VariabileProdotto))), TotRigaScontrino))


talk is cheap, supply exceeds demand
Not applicable
Author

Great! Thx a lot. When we use aggr it's a rule? We have to add the set analysis to the inner aggregation function too?

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Usually yes. It depends on what you're trying to calculate.


talk is cheap, supply exceeds demand