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: 
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.