Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
SI_NY02
Contributor III
Contributor III

Min Date and set analysis

I'm trying create a chart to answer the following question:

How many distinct customers, with date_type = 'Transaction Date', have placed their first order during any calendar year month. 

 

I've tried:

Count(aggr(If(tran_date = min(tran_date),({<DateType={'Transaction Date'} >}) distinct customer_id)

 

Labels (2)
1 Solution

Accepted Solutions
BrunPierre
Partner - Master
Partner - Master

Try

=Count(distinct {$<DateType={'Transaction Date'}>} Aggr(If(tran_date = Min(total<customer_id> tran_date), customer_id), customer_id))

View solution in original post

3 Replies
SI_NY02
Contributor III
Contributor III
Author

Update...  corrected formula, does not show an error, but returns all 0.

Count(aggr(If(tran_date = min(tran_date),({<DateType={'Transaction Date'} >}),1), distinct customer_id))

BrunPierre
Partner - Master
Partner - Master

Try

=Count(distinct {$<DateType={'Transaction Date'}>} Aggr(If(tran_date = Min(total<customer_id> tran_date), customer_id), customer_id))

SI_NY02
Contributor III
Contributor III
Author

Thank you BrunPierre!