Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

akuttler
New Contributor III

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.

Tags (1)
1 Solution

Accepted Solutions
MVP
MVP

Re: Nested Set Modifiers

May be this

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

7 Replies
MVP
MVP

Re: Nested Set Modifiers

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

akuttler
New Contributor III

Re: Nested Set Modifiers

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.

MVP
MVP

Re: Nested Set Modifiers

May be this

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

akuttler
New Contributor III

Re: Nested Set Modifiers

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

MVP
MVP

Re: Nested Set Modifiers

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

akuttler
New Contributor III

Re: Nested Set Modifiers

Awesome, its working thanks for your help.

MVP
MVP

Re: Nested Set Modifiers

Awesome...