Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi I am fairly new to Qlik and trying to write a load statement with several criteria. I need to only pull in new status id's and old status id's with a status change date greater than 01/01/2015. I only want new status ids that are 9 and old status ids that are null. I cannot get this to work and have tried multiple combinations from blogs. Any help is greatly appreciated!
WHERE [StatusChangeDate] >='01/01/2015' AND [NewStatusID] ='9'
OR [OldStatusID] = is null
Thank you sureshqv! That helps although, I have to find another way around this issue. There is a time stamp associated with the null value which I need to bring in.
Pls try this
WHERE [StatusChangeDate] >='01/01/2015' AND
([NewStatusID] ='9' or
isnull([OldStatusID]) )
-Sundar
Try,
WHERE ([StatusChangeDate] >='01/01/2015' AND [NewStatusID] ='9')
OR Len(Trim([OldStatusID])) = 0
Sorry [StatusChangeDate] >='01/01/2015' should not work correct since it is being checked in text format , i would prefer to do the check in num format rather bec we are not sure of what format the data field is in db.
try adding like
WHERE num([StatusChangeDate]) >=num(makedate(2015,1,1)) AND
([NewStatusID] ='9' or
isnull([OldStatusID]) )
where [StatusChangeDate] >='01/01/2015' and
(
[NewStatusID] =9
OR Len([OldStatusID]) = 0
)
WHERE num([StatusChangeDate]) >=num(date#('01/01/2015','DD/MM/YYYY')) AND ([NewStatusID] ='9'
OR Len(Trim([OldStatusID])) = 0)
Thank you for the help, this one did the trick.
Thank you everyone else for the support.
Cheers!