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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
shamitshah
Partner - Creator
Partner - Creator

Count function

Hi,

I am trying to count the number of items that are doing better compared to the previous year. I have two variables set up as follows which shows the total sales for the respective years:

v1)=num(sum(AGGR(SUM({<FiscalYear={2016}>}SLL_PriceExc),[Item Number])),'#.')

v2)= num(sum(AGGR(SUM({<FiscalYear={2015}>}SLL_PriceExc),[Item Number])),'#.')

I tried to use the following formula but it did not give any results:

=num(Count(DISTINCT( if (v1>v2,[Item Number]))))

Any ideas?

Thanks

Shamit

Labels (1)
10 Replies
shamitshah
Partner - Creator
Partner - Creator
Author

Thanks you Gysbert and Sunny. Both correct answers.

Awesome!

Shamit