Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Valerie
Contributor III
Contributor III

Sales many day but should count only first day

One shop can sell many day, I wanted to count only the first day of unique shop first day sold.

Here is my data

Sales DateShop
2-May-19A
2-May-19B
2-May-19A
3-May-19A
4-May-19B
5-May-19

C

 

Expected Result:

Sales DateCount(distinct Shop)
2-May-192
5-May-191

 

I want to write expression in the Qlik Sense application that could count just the first record by day. Selection of month and year can varie.

What I acutally want is , once the record sold on 1st day, then will count as 1, if the same shop sold the next day  or any other day, shouldn't count.

Labels (3)
1 Solution

Accepted Solutions
sunny_talwar

May be this

Sum(Aggr(If(Shop <> Above(Shop), 1, 0), Shop, ([Sales Date], (NUMERIC))))

View solution in original post

11 Replies
Sameer9585
Creator II
Creator II

try this?

count(distinct "Sales Date")

Valerie
Contributor III
Contributor III
Author

What I acutally want is , once the record sold on 1st day, then will count as 1, if the same shop sold the next day , shouldn't count.

Sameer9585
Creator II
Creator II

try this?

aggr(if(count(Shop)=1,Shop),Shop)

sunny_talwar

Why do you have a count of 1 on 3rd May? Shop A already sold on 2nd May....

Sameer9585
Creator II
Creator II

Sameer9585
Creator II
Creator II

try this? This is working

aggr(if(count({"Sales Date"=}Shop)=1,Shop),Shop)
Valerie
Contributor III
Contributor III
Author

I tried aggr(if(count({"Sales Date"=}Shop)=1,Shop),Shop) it doesn't work. 

Valerie
Contributor III
Contributor III
Author

Your formula didn't work.

One shop can sell many day, I wanted to count only the first day of unique shop first day sold.

Valerie
Contributor III
Contributor III
Author

Sorry my bad, I edited the result. 3rd May shouldn't be counted.