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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
nehasaxena
Creator II
Creator II

If Logic in script

Hi All,

I am trying to move 1 logic from front end to back end.

Front end Logic - 

Count(Distinct{

<T_Time_ID ={">=7"},Policy_Type_Flag={2},Status_Flag={2},PaymentGroup={2,3},OutstandingBalance_Flag={1}>

+

<T_Time_ID ={">=7"},Policy_Type_Flag={2},Status_Flag={2},PaymentGroup={1,4}>

} P_Q_ID)

Back end -

If(T_Time_ID >=7,

If(Policy_Type_Flag=2,

    If(Status_Flag=2,If(PaymentGroup=2 OR PaymentGroup=3,IF(OutstandingBalance_Flag= 1,1,0),0),0),0),0),

IF(T_Time_ID >=7,

If(Policy_Type_Flag=2,

    If(Status_Flag=2,If(PaymentGroup=1 OR PaymentGroup=4,1,0),0),0),0) as CurrentFlag

I am not sure how to put the condition in backend as 1 condition required outstanding flag and 1 not.

Thanks

Neha

1 Solution

Accepted Solutions
Anonymous
Not applicable

try this:

If((T_Time_ID >=7) and (Policy_Type_Flag=2) and (Status_Flag=2),

    If (((PaymentGroup=2) OR (PaymentGroup=3)) and (OutstandingBalance_Flag= 1),1,

    If ((PaymentGroup=1) OR (PaymentGroup=4),1 ,0))) as CurrentFlag

View solution in original post

3 Replies
YoussefBelloum
Champion
Champion

Hi,

I would've tried this:

if( (T_Time_ID >= 7 and Policy_Type_Flag = 2 and Status_Flag = 2 and Match(PaymentGroup,2,3) and OutstandingBalance_Flag = 1) OR (T_Time_ID >=7 and Policy_Type_Flag = 2 and Status_Flag = 2 and Match(PaymentGroup,1,4) ), 1, 0) as CurrentFlag

Anonymous
Not applicable

try this:

If((T_Time_ID >=7) and (Policy_Type_Flag=2) and (Status_Flag=2),

    If (((PaymentGroup=2) OR (PaymentGroup=3)) and (OutstandingBalance_Flag= 1),1,

    If ((PaymentGroup=1) OR (PaymentGroup=4),1 ,0))) as CurrentFlag

nehasaxena
Creator II
Creator II
Author

Hi,

This works fine, Thanks.

Neha