Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
ksasidhars
Creator
Creator

How do I conditionally LOAD rows in a table based on the value of a single field in the row?

hi, I've the table as below; need help

 

LOAD * Inline [
ID,Status
1,Open
1,Complete
2,Complete
3,Open
3,Complete];

 

I want to have the final table as

 


ID,Status
1,Open
2,Complete
3,Open

Basically single ID and if Status is Open for the ID in any Row then display status as 'open' else 'complete'

 

thank you

1 Solution

Accepted Solutions
sunny_talwar

You can try this

Table:
LOAD *,
Match(Status, 'Open', 'Complete') as Status_Num_Value;
LOAD * INLINE [
ID, Status
1, Open
1, Complete
2, Complete
3, Open
3, Complete
];

Right Join (Table)
LOAD ID,
Min(Status_Num_Value) as Status_Num_Value
Resident Table
Group By ID;

View solution in original post

2 Replies
sunny_talwar

You can try this

Table:
LOAD *,
Match(Status, 'Open', 'Complete') as Status_Num_Value;
LOAD * INLINE [
ID, Status
1, Open
1, Complete
2, Complete
3, Open
3, Complete
];

Right Join (Table)
LOAD ID,
Min(Status_Num_Value) as Status_Num_Value
Resident Table
Group By ID;

ksasidhars
Creator
Creator
Author

Thank you Sunny. Appreciated the quick response 

I'll try to customize this for my data.