Qlik Community

QlikView Security & Governance

Discussion Board for collaboration on QlikView Security and Governance.

Announcements
Qlik Analytics Tour 2020 Online. Begins August 10th. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor

Preceding Load Nested if statement issue

I want Status of each Shipment ID so i have used nested IF statement in preceding load.

I am using Straight table but getting two rows against some ShipmentID.

I don't want to use "Suppress when value is null" due to some specific business condition.

Could you please help me out here why i am getting blank status row here

gangelep_0-1589087767027.png

LOAD ShipmentID,
If(Loading_Time < Start,'Early',
If(Loading_Time>Stop,'Late',
If(Loading_Time>Start and Loading_Time < Stop,'On Time'))) As Status;
Load *,
Time([PL time]-Buffer_Early,'hh:mm') as Start,
Time([PL time]+Buffer_Late,'hh:mm') as Stop;
Load *
Resident Shipment;

1 Solution

Accepted Solutions
Highlighted
Digital Support
Digital Support

Re: Preceding Load Nested if statement issue

My best hunch would be you have a result that is not meeting your condition in the If statements, i.e. things are equal maybe, and therefore we do not know what status to apply.  Only way of which I can think to prove that is to cover that in the If statement by adding a final result of some other value if no other conditions are met.  So what I am saying is a final 'else' along the lines of something that will flag we have a condition that is not being met...

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.

View solution in original post

2 Replies
Highlighted
Master
Master

Re: Preceding Load Nested if statement issue

Sample Data and required output .. will give clear idea.

 

HirisH
“Aspire to Inspire before we Expire!”
Highlighted
Digital Support
Digital Support

Re: Preceding Load Nested if statement issue

My best hunch would be you have a result that is not meeting your condition in the If statements, i.e. things are equal maybe, and therefore we do not know what status to apply.  Only way of which I can think to prove that is to cover that in the If statement by adding a final result of some other value if no other conditions are met.  So what I am saying is a final 'else' along the lines of something that will flag we have a condition that is not being met...

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.

View solution in original post