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

Announcements
Discover the Trends Shaping AI in 2026: Register Here!
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
Partner - Champion III
Partner - Champion III

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
Partner - Champion III
Partner - Champion III

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
Partner - Champion III
Partner - Champion III

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.