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

Announcements
We are aware of an issue with the Product Downloads page and looking into it.
cancel
Showing results for 
Search instead for 
Did you mean: 
akuttler
Creator
Creator

Nested Set Modifiers

Hello,

I am new to Qlik Sense, building my first datamodel.

I have a table of transactions with fields 'ITEMTYPE' and 'ENCID' and 'Encounter Total Charges'

For the ITEMTYPE = 'F-C'

I need the sum('Encounter Total Charges') --->>>Sum({<ITEMTYPE={'F-C'}>}[Encounter Total Charges])

for Distinct ENCID --->>> Sum(({$<ITEMTYPE = {=DISTINCT ENCID}>}'F-C'>)[Encounter Total Charges])

The first expression works but not the second...I cant figure out how to to get the sum for unique encounters since there are duplicates in my table.

Thanks.

1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

May be this

Sum({<ITEMTYPE={'F-C'}>}Aggr([Encounter Total Charges], ENCID))

View solution in original post

7 Replies
sunny_talwar
MVP
MVP

What exactly are you trying to do here? Can you put the second expression in words?

akuttler
Creator
Creator
Author

I am trying to total encounter charges for all claims filed (item type F-C) by unique encounter ID. Since claims can be filed for a single encounter multiple times for secondary's/errors/refiles etc...it is duplicating the total encounter charges.

sunny_talwar
MVP
MVP

May be this

Sum({<ITEMTYPE={'F-C'}>}Aggr([Encounter Total Charges], ENCID))

akuttler
Creator
Creator
Author

Definitely lowered the total I am trying to verify if the # is accurate now. What does aggr do?

sunny_talwar
MVP
MVP

For a single ENCID, it will take only charge a single time

akuttler
Creator
Creator
Author

Awesome, its working thanks for your help.

sunny_talwar
MVP
MVP

Awesome...