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: 
Not applicable

Need help in Expression (Total)

Hi,

The expression which is not working as I am trying to find overall % of each customer, and the expression is as followed and the Tras_No has some duplicate records so when I use TOTAL with Distinct the expression become incorrect, could you please any one suggest workaround for this.

=Count(Distinct(Trs_No))/Count(TOTAL(Distinct(Trans_No)))

Regards

Chriss

3 Replies
Not applicable
Author

try this

=Count(Distinct(Trs_No))/Count(TOTAL Distinct(Trans_No))

Not applicable
Author

also try this

=Count(Distinct  Trs_No)/Count(TOTAL Distinct Trans_No)

Anonymous
Not applicable
Author

Total for each customer would need to have something like this:

    =Count(Distinct(Trs_No))/Count(TOTAL <Customer> (Distinct(Trans_No)))

Alternatively, I think you can also use the Aggr() function like this:

    =Count(Distinct(Trs_No))/Aggr(Count((Distinct(Trans_No))), Customer)

Jonathan