Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
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

10 Replies
shamitshah
Partner - Creator
Partner - Creator
Author

Thanks you Gysbert and Sunny. Both correct answers.

Awesome!

Shamit