Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Count stores with sales in previous year

Hi,

I need to count the number of stores that had sales the previous year as well as for the current year then compare the two.

The expression should also disregard any selections made for 'Year' & 'Month'

I use the following to count the stores across all period, what do I need to change for it to only consider the previous year?

=count({$<[Sales]={">0"} >} distinct [Store Name])

'Sales' is the field name that holds the sales value

2 Replies
rajni_batra
Specialist
Specialist

try to  use Max(year), and max(year)-1 for current year and previous year respectively...

Hope it Helps!!!

somenathroy
Creator III
Creator III

Hi,

For Current year :

Count( {< sales = {'>0'}, year = {'$(=Max(year))'}, month = {'$(=Max(month))'}, year, month >} stores )

For Previous year:

Count( {< sales = {'>0'}, year = {'$(=Max(year) - 1)'}, month = {'$(=Max(month))'}, year, month >} stores )

Regards,

Som