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: 
dranjbar
Contributor III
Contributor III

Sum of the result of a field and measure

Hi All,

I've created this table which gives me the total value that I am looking for which is 44 here but I can not figure out how to get this result into a KPI/measure. I believe its because its using both a field and a measure to give me the result value.

I've tried a few different combinations using aggr which I believe is the correct method but cant seem to get to a solution.

dranjbar_0-1629418654637.png

 

My field is: TestName

My measure is: count({<mTestResults={1}>} distinct [Patient ID])

Thought this might work but it didnt: Sum(Aggr(TestName, count({<mTestResults={1}>} distinct [Patient ID])))

 

 

I believe it may be because my measure is nested with a count? I'm not too sure.

Any help would be appreciated.


Thanks

1 Solution

Accepted Solutions
Vegar
MVP
MVP

You swapped the order  of the aggr parameter. Try this expression:

Sum(Aggr(count({<mTestResults={1}>} distinct [Patient ID]),TestName))

View solution in original post

2 Replies
Vegar
MVP
MVP

You swapped the order  of the aggr parameter. Try this expression:

Sum(Aggr(count({<mTestResults={1}>} distinct [Patient ID]),TestName))

dranjbar
Contributor III
Contributor III
Author

Yep that did the trick, can't believe I missed that.

Thanks!