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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
evilbyte
Contributor
Contributor

Count of Sum Formula which returns a negative value?

I am dealing with 4 car dealerships.

I want to determine which dealerships are growing over the previous year based on the current week of the year.

Here's my thought process:

Sum(Sales2022[Current Week])-Sum(Sales2021[Same Week Last Year])=X

I then want to Declining = COUNT where X < 0

There are 2 dealerships declining based on this formula.

 

-----

 

I have been playing around with variants of these but am at a complete loss:

 

[Date]={"=inweek([Date],today(1),-1)

[Date]={"=inweek([Date],today(1),-53)

I can gather the sales of each week and then I can subtract them but it is the count of this subtraction that appears to be giving me trouble.

 

SUM({<[Date]={"=inweek([Date],today(1),-1)"}>}[Sales])

-

SUM({<[Date]={"=inweek([Date],today(1),-53)"}>}[Sales])

 

How would I approach counting the above where each dealership is negative (decline?)

 

 

Labels (3)
1 Reply
jmartineze
Partner - Creator
Partner - Creator

hi,

you can try if(sum1>=sum2,sum1-sum2)