Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
apichana
Contributor III
Contributor III

How to count record with have the same date

Please advise how to count no. of customer records buying any product on the same date . 

CustomerProduct  Transaction_Date
Axxx 01/01/2020 
Ayyy 01/01/2020
Azzz02/01/2020
Bxxx01/01/2020
Byyy01/01/2020
Bzzz01/01/2020
Bxxx02/01/2020
Czzz01/01/2020

 

Expected result 

CustomerTransaction DateCount
A01/01/20202
A02/01/20201
B01/01/20203
B02/01/20201
C01/01/20201

 

3 Solutions

Accepted Solutions
MayilVahanan

Hi @apichana 

Try like below

Dim: Customer, Transaction Date

Measure: Count(Product) 

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

MayilVahanan

Hi @apichana 

Try like below

Sum(Aggr(If(count(distinct Transaction) > 3, 1, 0), Customer, Date))

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

apichana
Contributor III
Contributor III
Author

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? 

 

 

 

View solution in original post

10 Replies
MayilVahanan

Hi @apichana 

Try like below

Dim: Customer, Transaction Date

Measure: Count(Product) 

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
apichana
Contributor III
Contributor III
Author

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.  

MayilVahanan

Hi @apichana 

Try like below

Sum(Aggr(If(count(distinct Transaction) > 3, 1, 0), Customer, Date))

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
apichana
Contributor III
Contributor III
Author

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? 

 

 

 

MayilVahanan

Yes, it's ur transaction field name..
Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
apichana
Contributor III
Contributor III
Author

Hi MayilVahanan, 

It works now. Thank you so much for your help.  

 

Daniel_C
Contributor
Contributor

I am also having this issue. Kindly please provide any relevant solution.

 

 

tellthebell

sunil_sawargave
Contributor III
Contributor III

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
MayilVahanan

Hi

You can create the table with  Date and ShopName as Dimension

Measure: sum([SCRAP COST]) 

it will help you

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.