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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
aarnkalle
Contributor III
Contributor III

Need your help

Hi

I am trying to put below conditions ONLY IF SendDate is latest but i am not getting correct output. Please suggest.

If ((Net <> 0) AND RangeMax ((SendDate)) ,


  If ((([AmtRcd] + [RecoveryAmt]) = 0) and (len ([DenialCode]) < 2) , 'Pending for Action' ,    

           

     If ((([AmtRcd] + [RecoveryAmt]) = 0) and (len([DenialCode]) > 2), 'Rejected' ,

   

     If ((([AmtRcd] + [RecoveryAmt]) > 0) and (len([DenialCode]) > 2), 'Rejected' ,

   

     If ((([AmtRcd] + [RecoveryAmt]) > 0) and (([Net]-([AmtRcd]) + ([RecoveryAmt]))> 0) , 'Rejected',

 

     If ((([Net]-([AmtRcd]) + ([RecoveryAmt]))) <0, 'Probable Take Back' )))))) , 'Pending for Action' AS [Payment Status] ;


Thanks and Regards,


Abhijit.

1 Solution

Accepted Solutions
petter
Partner - Champion III
Partner - Champion III

Using RangeMax like this will always return the actual date of SendDate and not a maximum.

You might have to determine Max(SendDate) separately before this load and then assign this to a variable so you can compare in your subsequent load statement.

MAXSENDDATE:

LOAD Max(SendDate) AS MaxSendDate RESIDENT someTable;

vMaxSendDate = Peek('MaxSendDate',0,'MAXSENDDATE');

DROP TABLE MAXSENDDATE;

LOAD

    ....

    .....

  If ((Net <> 0) AND SendDate = $(vMaxSendDate)  ,

    If ((([AmtRcd] + [RecoveryAmt]) = 0) and (len ([DenialCode]) < 2) , 'Pending for Action' ,   

      If ((([AmtRcd] + [RecoveryAmt]) = 0) and (len([DenialCode]) > 2), 'Rejected' ,

      If ((([AmtRcd] + [RecoveryAmt]) > 0) and (len([DenialCode]) > 2), 'Rejected' ,

        If ((([AmtRcd] + [RecoveryAmt]) > 0) and (([Net]-([AmtRcd]) + ([RecoveryAmt]))> 0) , 'Rejected',

          If ((([Net]-([AmtRcd]) + ([RecoveryAmt]))) <0, 'Probable Take Back' )))))) , 'Pending for Action' AS [Payment Status] ;




View solution in original post

3 Replies
petter
Partner - Champion III
Partner - Champion III

Using RangeMax like this will always return the actual date of SendDate and not a maximum.

You might have to determine Max(SendDate) separately before this load and then assign this to a variable so you can compare in your subsequent load statement.

MAXSENDDATE:

LOAD Max(SendDate) AS MaxSendDate RESIDENT someTable;

vMaxSendDate = Peek('MaxSendDate',0,'MAXSENDDATE');

DROP TABLE MAXSENDDATE;

LOAD

    ....

    .....

  If ((Net <> 0) AND SendDate = $(vMaxSendDate)  ,

    If ((([AmtRcd] + [RecoveryAmt]) = 0) and (len ([DenialCode]) < 2) , 'Pending for Action' ,   

      If ((([AmtRcd] + [RecoveryAmt]) = 0) and (len([DenialCode]) > 2), 'Rejected' ,

      If ((([AmtRcd] + [RecoveryAmt]) > 0) and (len([DenialCode]) > 2), 'Rejected' ,

        If ((([AmtRcd] + [RecoveryAmt]) > 0) and (([Net]-([AmtRcd]) + ([RecoveryAmt]))> 0) , 'Rejected',

          If ((([Net]-([AmtRcd]) + ([RecoveryAmt]))) <0, 'Probable Take Back' )))))) , 'Pending for Action' AS [Payment Status] ;




aarnkalle
Contributor III
Contributor III
Author

Thanks for your help.

petter
Partner - Champion III
Partner - Champion III

You're welcome - glad to help