Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator II
Creator II

Reverse logic in loadscript

Please help me to create Flag using the below logic. Thanks

Capture.JPG

LOAD * INLINE [

    ID, Base, Status

    1, ABC, Open

    2, DEF, Open

    3, HIJ, Close

    4, ABC, Close

    5, HIJ, Close

    6, ABC, Open

    7, HIJ, Open

    8, DEF, Open

    9, DEF, Close

    10, ABC, Close

];

1 Solution

Accepted Solutions
Highlighted
Creator III
Creator III

Maybe like this?

Temp: (Load inline)

Final:

LOAD

    *,

    If(Status='Open', if(Base='ABC', 'Yes', 'No'), 'No') as Flag

Resident Temp;

Drop table Temp;

View solution in original post

3 Replies
Highlighted
Creator III
Creator III

Maybe like this?

Temp: (Load inline)

Final:

LOAD

    *,

    If(Status='Open', if(Base='ABC', 'Yes', 'No'), 'No') as Flag

Resident Temp;

Drop table Temp;

View solution in original post

Highlighted
Creator II
Creator II

Jens answer is correct.

just modifying the if statement to differentiate 2 No's


Temp:


LOAD * INLINE [

ID, Base, Status

1, ABC, Open

2, DEF, Open

3, HIJ, Close

4, ABC, Close

5, HIJ, Close

6, ABC, Open

7, HIJ, Open

8, DEF, Open

9, DEF, Close

10, ABC, Close

];


Final:


Load *,

If(Status='Open', if(Base='ABC', 'Yes', 'No'), 'Other') as Flag

Resident Temp;


DROP Table Temp;

Highlighted
Creator III
Creator III

You're right, I didn't even think about this. Though judging by OP's images anything that isn't ABC and Open gets a No flag anyway regardless of which condition fails. Nevertheless, good addition.