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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Aggr Expression

Hi Developers,

I have a requirement  to convert normal if condition expression to aggr expression.

If Condition Expression:

((sum( if(Payor_ID = 'MDTX' and Adjudicated=0 and High_Risk_NIPT = 'yes' and (Test_Family_2 = 'NIPT' or Test_Family_2 = 'NIPTMD'),

           High_Risk_Medicaid*.8,

       if(Payor_Group_3 = 'State Medicaid' and Adjudicated=0 and High_Risk_NIPT = 'yes' and (Test_Family_2 = 'NIPT' or Test_Family_2 = 'NIPTMD'),

              High_Risk_Medicaid)))

  +

  sum( if(Payor_Group_3 = 'State Medicaid' and Adjudicated=0 and Test_Family_2 = 'HCS', HCS_Medicaid))

)/Count(distinct Accession_ID)

)* %Medicaid_attainable

AGGR Expression (I wrote):

((sum(aggr((if(Payor_ID = 'MDTX' and Adjudicated=0 and High_Risk_NIPT like 'Yes' and (Test_Family_2 = 'NIPT' or Test_Family_2 = 'NIPTMD'),

High_Risk_Medicaid*.8,

if(Payor_Group_3 = 'State Medicaid' and Adjudicated=0 and High_Risk_NIPT = 'yes' and (Test_Family_2 = 'NIPT' or Test_Family_2 = 'NIPTMD'),

High_Risk_Medicaid))), Accession_ID))

+

sum(aggr((if(Payor_Group_3 = 'State Medicaid' and Adjudicated=0 and Test_Family_2 = 'HCS', HCS_Medicaid)), Accession_ID)))

  / count(distinct Accession_ID)) * %Medicaid_attainable

I have just modified sum calculation to distinct Accession_ID.

But surprisingly its not working(I mean am not getting equal vales for both expressions)

Can someone please help me to solve this?

Thanks in advance

Thanks,

Rohini. M

2 Replies
Anil_Babu_Samineni

Would you be able to provide application which demonstrates the o/p

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Not applicable
Author

Sorry Anil I cannot provide the application. But here is the sample output.

 

Month       normal IF           aggr if
$3.86$4.23
11/1/2015$0.00$0.00
9/1/2015$0.00$0.01
2/1/2016$0.00$0.00
7/1/2015$0.01$0.01
8/1/2015$0.01$0.01
12/1/2015$0.01$0.01
10/1/2015$0.01$0.01
1/1/2016$0.01$0.01
5/1/2015$0.01$0.01
6/1/2015$0.02$0.02
1/1/2015$0.02$0.02
4/1/2015$0.03$0.03
3/1/2015$0.03$0.03
2/1/2015$0.04$0.04
3/1/2016$0.24$0.24
5/1/2016$0.70$0.79
4/1/2016$0.71$0.72
7/1/2016$0.99$1.11
6/1/2016$1.05$1.18

Am not getting equal amount for both expressions. I am just testing whether my aggr expression is correct or do I need to do some changes.