Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Qlik Analytics Tour 2020 Online. Begins August 10th. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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

Tags (2)
1 Solution

Accepted Solutions
Highlighted
Partner
Partner

Re: If Logic in script

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
Highlighted
Champion
Champion

Re: If Logic in script

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

Highlighted
Partner
Partner

Re: If Logic in script

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

Highlighted
Creator II
Creator II

Re: If Logic in script

Hi,

This works fine, Thanks.

Neha