Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Please advise how to count no. of customer records buying any product on the same date .
Customer | Product | Transaction_Date |
A | xxx | 01/01/2020 |
A | yyy | 01/01/2020 |
A | zzz | 02/01/2020 |
B | xxx | 01/01/2020 |
B | yyy | 01/01/2020 |
B | zzz | 01/01/2020 |
B | xxx | 02/01/2020 |
C | zzz | 01/01/2020 |
Expected result
Customer | Transaction Date | Count |
A | 01/01/2020 | 2 |
A | 02/01/2020 | 1 |
B | 01/01/2020 | 3 |
B | 02/01/2020 | 1 |
C | 01/01/2020 | 1 |
Hi @apichana
Try like below
Dim: Customer, Transaction Date
Measure: Count(Product)
Hi @apichana
Try like below
Sum(Aggr(If(count(distinct Transaction) > 3, 1, 0), Customer, Date))
Hi Mayil Vahanan R,
Thank you for your advise. Sum(Aggr(If(count(distinct Transaction) > 3, 1, 0), Customer, Date)) -- > Transaction means field name that need to count right?
Hi @apichana
Try like below
Dim: Customer, Transaction Date
Measure: Count(Product)
Hi Mayil Vahanan R,
Thank you so much for your advice. I got the result already. However, if I would like to add a calculation field for customers who have make a transaction on the same date more than 3 times per day. What would be the script to do that.
Hi @apichana
Try like below
Sum(Aggr(If(count(distinct Transaction) > 3, 1, 0), Customer, Date))
Hi Mayil Vahanan R,
Thank you for your advise. Sum(Aggr(If(count(distinct Transaction) > 3, 1, 0), Customer, Date)) -- > Transaction means field name that need to count right?
Hi MayilVahanan,
It works now. Thank you so much for your help.
Hello , i am new on qlik sense, pls
DATE | SHOP NAME | SCRAP COST |
23/05/2022 | A1 | 55.123 |
23/05/2022 | A1 | 663.12 |
23/05/2022 | A1 | 456.12 |
Required Output
Date | Shop Name | SUM of SCRAP COST |
23/05/2022 | A1 | 55.123+663.12+456.12 |
Hi
You can create the table with Date and ShopName as Dimension
Measure: sum([SCRAP COST])
it will help you