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: 
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

May be this

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

View solution in original post

7 Replies
sunny_talwar

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

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

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

Awesome...