Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
kolov007
New 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.

Tags (1)
1 Solution

Accepted Solutions
MVP
MVP

Re: Quantity days with sales more than 0

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
MVP
MVP

Re: Quantity days with sales more than 0

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

Re: Quantity days with sales more than 0

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.