Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
dseelam
Creator II
Creator II

Multiple conditions

Hello All,

 attached Qvw and written inline source below 

am trying to create close out field using below statement but failing

if(len(trim(date([BeginDate])))=0 and len(trim(date([EndDate])))=0 , this means if both BeginDate & EndDate are null consider item 12 as close out


if(len(trim(date([Begin Date])))>0 , starting this date item 1234 falls under close out


if(len(trim( date([Begin Date] and date([End Date]>0)))),'Closeouts','Excl Closeout'))) as Closeout

between this dates item 12345 should fall under this criteria

all other scenarios like item 123 should fall under Excl Closeout

 

Source

load*
inline

[Item,BeginDate, EndDate
12, ,
123,-1, ,
1234,02/15/2018,
12345,02/17/2018,05/16/2018];

Please help 

thanks,

D

Labels (3)
3 Replies
Nicole-Smith

I think the following meets your criteria:

between this dates item 12345 should fall under this criteria
all other scenarios like item 123 should fall under Excl Closeout

 

Script:

Source:
load *, 
	if(len(trim([BeginDate]))>0 and len(trim([EndDate]))>0,'Closeouts','Excl Closeout') as Closeout 
inline [
Item,BeginDate, EndDate
12, ,
123,-1, ,
1234,02/15/2018,
12345,02/17/2018,05/16/2018
];

 

Output:

Item BeginDate EndDate Closeout 
12  Excl Closeout
123-1 Excl Closeout
12342/15/2018 Excl Closeout
123452/17/20185/16/2018Closeouts
dseelam
Creator II
Creator II
Author

Hello Nicole,

 

This scenario worked only for Item 12345, except 123 with -1 begin date everything should fall under closeouts.

Example:

Capture.PNG

 

Thanks,

D

Nicole-Smith

Can you please give what you want the final table to look like?  I can help write the code for it, but only if I can understand what the final output should look like.