Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Count distinct Customers

In the Excel file the data is:

CustomerTypeDocDate

In 2 controls I select 2 dates: Initial date and Final date

I need to count how many different customers there are between the dates, and TypeDoc = 'TA'

Example:

Initial Date: May 02, 2012 <-- In variable VarDate1

Final Date: May 31, 2012 <-- In variable VarDate2

TypeDoc = 'TA'

The answer is 46 customers, but I can't create a aggr expresion that show it.

I have this but don't works:

Count(DISTINCT aggr(If(Date >= $(VarDate1) and Date <= $(Vardate2) and TypeDoc= 'TA',Customer), Customer))

Thanks.

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

Hi,

Please find attached file for solution.  I used this expression

=Count({<CustomerDate={'>=$(=VarDate1)<=$(=VarDate2)'}, TypeDoc= {'TA'}>} DISTINCT Customer)

VarDate1 = MakeDate(2012, 5, 2)

VarDate2 = MakeDate(2012, 5, 31)

Regards,

Jagan.

View solution in original post

3 Replies
jagan
Luminary Alumni
Luminary Alumni

Hi,

Please find attached file for solution.  I used this expression

=Count({<CustomerDate={'>=$(=VarDate1)<=$(=VarDate2)'}, TypeDoc= {'TA'}>} DISTINCT Customer)

VarDate1 = MakeDate(2012, 5, 2)

VarDate2 = MakeDate(2012, 5, 31)

Regards,

Jagan.

Not applicable
Author

Thanks.!!.

jagan
Luminary Alumni
Luminary Alumni

HI,

Please close the discussion by clicking Correct Answer button to my post if it solves your purpose, it helps others to find the answer.

Regards,

Jagan.