Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good afternoon,
I am trying to code the following portion of pseudo code into a Qlik script but am not having any luck
My attempt using a do while yielded no new fields as output:
Do while Rebate_Dollars = 0 LOAD *, [Clm Apprv Mem Paid] as Org_Mem_Paid, [Clm Apprv Gross Due Amt] as Org_Plan_Paid, [Clm Deduct Amt] as New_Mem_Paid, MED_DEDUCT + [Clm Deduct Amt] as New_Blend_Ded, LOOP resident ACCUMPREP;
My attempt using nested if then else logic from post on Qlik Community. Obviously not correct based on syntax errors I see in editor.
CLAIMS1: LOAD *, if(Rebate_Dollars = 0,{ [Clm Apprv Mem Paid] as Org_Mem_Paid, [Clm Apprv Gross Due Amt] as Org_Plan_Paid, [Clm Deduct Amt] as New_Mem_Paid, MED_DEDUCT + [Clm Deduct Amt] as New_Blend_Ded}); elseif Rebate_Dollars = 0 resident ACCUMPREP;
My attempt using sub routine in an if statement.
CLAIMS1: LOAD *, if(Rebate_Dollars = 0, call ZeroRebates (Org_Mem_Paid, Org_Plan_Paid, New_Mem_Paid, New_Blend_Ded)) resident ACCUMPREP;
sub ZeroRebates (Org_Mem_Paid,Org_Plan_Paid,New_Mem_Paid,New_Blend_Ded) Org_Mem_Paid = [Clm Apprv Mem Paid] Org_Plan_Paid = [Clm Apprv Gross Due Amt] New_Mem_Paid = [Clm Deduct Amt] New_Blend_Ded = MED_DEDUCT + [Clm Deduct Amt] endsub
If someone has any suggestions on how this logic would best be coded I would be greatful.
Thanks
S.