Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi all,
simple question i hope!
im looking to put in a statement at the beginning of a qlikview script where it will look at my SQL date/timecolumn and if there is a time/date recorded that is within the last 5 minutes then it will load all, if not it will fail the script.
i know i could put in a simple where clauses but i need it to fail if there is no date/time recorded in the last 5 minutes.
any ideas?
thanks
Hi @BSCIknowlec
Try like below
table:
LOAD * from yourtable where condition;
LET a = NoOfRows('table');
if $(a)=0 then
EXIT SCRIPT;
ENDIF;
If the no.of rows in ur table is zero , then it will end the script.
This allows the majority of page content (like images, tables, text) to be loaded and rendered first. The user sees content loading, so the page looks responsive. At this point, the heavy javascripts can begin loading near the end.
Hi Mayril, thanks for your suggestion. however i need the script to actually fail and not just end the run, as in my qmc i will have my much larger app only run if this smaller app is successful, and if i just put an exit script it would always be successful. my current code is:
test:
load *;
if alt( NoOfRows('Update_Time,'), 0) < 1 then asdfkjsdflkks(any wrong command); end if
SQL Select ID, Update_Time, detail .... from... where Update_Time >= dateadd(minute, datediff(minute, 0, getdate()) -5, 0)
order by Update_Time desc;
however when i run it always fails? i need it to pass if my update time table(or any table) has data in it
any suggestions?
thanks
This allows most of the page content (e.g. images, spreadsheets, text) to be downloaded and displayed first. The user sees the content being uploaded to make the page look relevant. At this point, heavy javascript may start loading at the end.
Instead of exit script; within the if-loop you could simply write: no current data available and now the script failed ... Any invalid statement will do the job.
- Marcus