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

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Count If Set Expression / Count total expression

Hi All,

I have the following expression:

if(sum({<Week_Commencing = {'$(vMaxDate)'}>} [ABC]) <= 1 , count({<Week_Commencing = {'$(vMaxDate)'}>} [Ship-to Code]))

Which when used in a straight table with product as a dimension gives me the count of ship-to that have an ABC less than or equal to 1.

What I then want to do is calculate this as a % of total, which also in a straight table is:

sum({<Week_Commencing = {'$(vMaxDate)'}>} [ABC])

However, clearly I need this as count of the number of ship-to's

So... what I am trying to get to is the count of ship-to's with an ABC less than or equal to 1 as a percentage of the total count of ship-to's in a straight table with product as a dimension.

Sorry if this isn't very clear!

Thanks folks

2 Replies
Qrishna
Master
Master

please share a sample.

may be like this,but not sure without seeing the data:

if(sum({<Week_Commencing = {'$(vMaxDate)'}>} [ABC]) <= 1 ,

   count({<Week_Commencing = {'$(vMaxDate)'}>} [Ship-to Code]))  /

count( total {<Week_Commencing = {'$(vMaxDate)'}>} [Ship-to Code])


and format the output with num() function according  to the requirement.


sasiparupudi1
Master III
Master III

please post your application