Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
kolov007
Contributor III
Contributor III

Quantity days with sales more than 0

Hello.

I need to calculate quantity of days with sales more than 0 in the context of each store.

I use expression "Count({<Date = {"=sum(Quantity)>0"}>} DISTINCT Date)" but it doesn't work.

Screenshot_2.png

Help me please to solve this problem.

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Capture.JPG

Create a composite key field in the script like:

Load

      Shop&Date as Key,

      *

Resident Base;

And then use expression like: =Count({<Key={"=sum(Quantity)>0"}>} DISTINCT Date)

View solution in original post

2 Replies
tresesco
MVP
MVP

Capture.JPG

Create a composite key field in the script like:

Load

      Shop&Date as Key,

      *

Resident Base;

And then use expression like: =Count({<Key={"=sum(Quantity)>0"}>} DISTINCT Date)

sunny_talwar

Alternatively, you can also try this

Count(DISTINCT Aggr(If(Sum(Quantity) > 0, Date), Shop, Date))

But if you can, I would suggest you to change your data model so that you can use set analysis, just like tresesco‌ mentioned above.