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: 
JLob
Contributor II
Contributor II

How to create a measure to sum certain values on a column based on another column's values?

So on the table below I have "Count_" values on the far right and on the far left I have "CPOE_Ord_Ind". I want to create a measure so that it will sum up all the values in "Count_" only if "CPOE_Ord_Ind" shows "Y". So based on the table below I want the result of 9. Sorry if this is trivial but I'm new to Qlik Sense.

sum.PNG

Labels (2)
3 Replies
vchuprina
Specialist
Specialist

Hi, 

Try this:

Sum({<CPOE_Ord_Ind={'Y'}>}Count_)

 

Regards,

Vitalii

Press LIKE if the given solution helps to solve the problem.
If it's possible please mark correct answers as "solutions" (you can mark up to 3 "solutions").
JLob
Contributor II
Contributor II
Author

Thank you for your reply. I tried that one but it didn't work for me.

So I tried this instead:

Sum({<CPOE_Ord_Ind={'Y'}>}num(trim(Count_)))

This seemed to work perfectly, but I have no idea why. I'm still learning Qlik Sense.

Thanks again though!

vinieme12
Champion III
Champion III

This means you have blank spaces in your fieldvalues, suggest you trim(Count_) while loading the data in your script

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.