Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Peony
Creator III
Creator III

Percentage value calculates only partly

Hi all. 

I faces with an issue in set analysis calculation for percentage for column % CIDs. 
For some reason I have calculated result only for Type P transactions. And I received nothing for Type W.  

To calculate I use this formula:

Count(Distinct CID)
/
Sum(Aggr(Count(Distinct CID), Market))

How to get result also for Type W?

Peony_0-1631110276337.png

 

 

Labels (1)
1 Solution

Accepted Solutions
stevejoyce
Specialist II
Specialist II

You denomiator Aggr(Count(Distinct CID), Market) is only going to return 1 row for each Market, hence why P has a denominator but not W.

What do you want your denominator to be? Are you trying to sum all  types for each market?  So Barcelona is denominator of 205 and German is 57?

If so, that calculation would be like this:

Count(Distinct CID)
/
Count(Total <Market> Distinct CID)

View solution in original post

2 Replies
stevejoyce
Specialist II
Specialist II

You denomiator Aggr(Count(Distinct CID), Market) is only going to return 1 row for each Market, hence why P has a denominator but not W.

What do you want your denominator to be? Are you trying to sum all  types for each market?  So Barcelona is denominator of 205 and German is 57?

If so, that calculation would be like this:

Count(Distinct CID)
/
Count(Total <Market> Distinct CID)

Peony
Creator III
Creator III
Author

Yes! Your suggestion is exactly what I need.  Thank you much for help!