Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have problem with reload old data in script.
I want check some condition and if it`s true then load table from database but if it`s false then reload old data...
Example:)
If vA=5 then
Load
...
else
Reload Old Data;
Is it possible? Any Idea?
Yes possible. Have you tried? Is there any issues you are facing?
Yes it is possible; you can make use of below sample code snippet:
if $(vLoadOldData) <> 0 then
Table1:
LOAD *
FROM Old.qvd(QVD);
ELSE
Table1:
LOAD *
FROM New.qvd(QVD);
ENDIF
Hope this will be helpful.
Regards!
Rahul Pawar
May be this?
LET vNew = Date(Today());
If vA = 5 THEN
Load * From Table where PrimaryKey >= '$(vNew)';
ELSE
Load * From Table Where PrimaryKey <= '$(vNew)';
I should trace each table to reload old data??
Olik doesn`t have more simply way to solve this problem ( some function like exit stript etc....)??
If vA=5 then
// reload by new data
Table1:
Load from dbo.orders;
Table2:
Load from dbo.Clients;
else
// reload by old data
Table1
Load from //filepath/report_name.qvd(QVD);
Table2:
Load from //filepath/report_name.qvd(QVD);
ENDIF
Yes it does, EXIT SCRIPT is the syntax. When this statement is read, the script finishes. See here for further reference and options to use WHEN or UNLESS along with EXIT SCRIPT:
Actually your code is quite similar to an actual QlikView script, and can be further refined to cover more cases.
When i use Exit Script Table1 and Table2 are empty... but i need old data in Table1 and Table2.
Perhaps your load statements are not correct or the tables or files empty?
load statement is correct
table isnt empty
Example below
In the ELSE you only have EXIT SCRIPT; if you still want the old data you will need to load it there, otherwise if minute is less than 30 then the script does nothing (exits)