Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
If (data came from folder x, (do this...),(Else do this...)
Is this possible? If so, what syntax would you suggest?
Thank you,
John
Maybe something like this:
SET vFolderXFile = 'FolderX\FileName.xlsx';
LET vFolderXExist = If(FileSize(vFolderXFile) > 0, -1, 0);
SET vFolderYFile = 'FolderY\FileName.xlsx';
LET vFolderYExist = If(FileSize(vFolderYFile) > 0, -1, 0);
IF $(vFolderXExist) then
...
ENDIF;
IF $(vFolderYExist) then
...
ENDIF;
HTH
Best,
Sunny
What kind of things are you trying to achieve?
During the load process, you know from which folder you are loading, so do you really need the if-statement? You can just implement those expressions / functions while loading from the specific source.
So, please try to explain what exactly you are trying to do or achieve so we can give you a more specific answer .
A system my company uses was recently upgraded and changed the date format in a particular field.
The date used to be: Fri Aug 01 01:58:00 GMT 2014
Now it is: 3/28/2015 3:42:11 PM
We already have scripting to break down the old date into just the Date and Time fields from the historical files, but I need to create a script to separate the date and time for the date field from the new files.
My thinking was: (part of this is now being based off of Sunny’s suggestion, whom I still need to thank for the suggestion.)
SET vFolderXFile = 'FolderX\FileName.xlsx';
LET vFolderXExist = If(FileSize(vFolderXFile) > 0, -1, 0);
If($(vFolderXExist),
(Date(Floor(Timestamp#(CreatedTime-Time#(4,'MM/DD/YYYY'))))),
(Date(Floor(Timestamp#(replace((Right(Trim(CreatedTime),24)),'GMT ',''),'MMM DD hh:mm:ss YYYY')-0.208333333),'MM/DD/YYYY')))
as ,
If the old system is phased out, than maybe you do not need to keep loading the old files.
Load them once, store them as QVD, and in the future only load that QVD.
In your load script, load the new source files (while in the process adjusting your date to how Qlik stores it), followed by loading your QVDs which will now automatically concatenate.
But maybe I am completely misunderstanding your problem.