Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

combining two scripts to 1

Hi There,

I'm quit new to qlikview and therefore still struggeling with "advanced" scripting.

if(Interval(Date(Date#(POD,'DD-MM-YYYY hh:mm'), 'DD-MM-YYYY hh:mm') - date(Date#(DEP, 'DD-MM-YYYY hh:mm'),'DD-MM-YYYY hh:mm'), 'd hh:mm') <= 8,'ON TIME','LATE') as Status.


if(
Interval(Date(Date#(POD, 'DD-MM-YYYY hh:mm'), 'DD-MM-YYYY hh:mm') -date(Date#(DEP, 'DD-MM-YYYY hh:mm'), 'DD-MM-YYYY hh:mm'), 'd hh:mm') <= 7,'ONTIME','LATE') as StatusII.


How can I combine both scripts to 1 script/field? Suppose I want to state that shipments to destination [which is the fieldname] “JFK” have a maximum of 8 days and shipments to “DBX” have a maximum of 7 days. Should I use another if statement?

I want to do this so I don’t have to create a field for each specific ‘requirement’.

Thanks in advance!!!

Regards,

iSam

12 Replies
Not applicable
Author

Ich werde ab 05.09.2011 nicht im Büro sein. Ich kehre zurück am

23.09.2011.

Ich werde Ihre Nachrichten nach meiner Rückkehr beantworten.

Diese E-Mail kann Betriebs- oder Geschäftsgeheimnisse oder sonstige vertrauliche Informationen enthalten. Sollten Sie diese E-Mail irrtümlich erhalten haben, ist Ihnen eine Verwertung des Inhalts, eine Vervielfältigung oder Weitergabe der E-Mail ausdrücklich untersagt.

Bitte benachrichtigen Sie uns und vernichten Sie die empfangene E-Mail. Vielen Dank!

Not applicable
Author

Ich werde ab 05.09.2011 nicht im Büro sein. Ich kehre zurück am

23.09.2011.

Ich werde Ihre Nachrichten nach meiner Rückkehr beantworten.

Diese E-Mail kann Betriebs- oder Geschäftsgeheimnisse oder sonstige vertrauliche Informationen enthalten. Sollten Sie diese E-Mail irrtümlich erhalten haben, ist Ihnen eine Verwertung des Inhalts, eine Vervielfältigung oder Weitergabe der E-Mail ausdrücklich untersagt.

Bitte benachrichtigen Sie uns und vernichten Sie die empfangene E-Mail. Vielen Dank!

lucas4bi
Partner - Creator
Partner - Creator

the IF expression should be like this:

If(destination='IZM' or destination='AMS', 7)       you have to compare the field everytime.

i think it's correct the result of your expression, because in the first case (Status2) you are checking only what is <=7 and most is on time,

in the second case you are also checking what is <=8 for some destination, so it is logical to me that you have more  'Late' results...