Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
I'm trying to load some qvds based on specific hours and until now I don't have success. I'm already thinking it's a bug. I'm assuming this because when I copied this same script and put in a new App, it works. So I don't understand why this happens but it's annoying just think that I may need to create a new app to fix this.
IF HOUR(NOW()) > 4 AND HOUR(NOW()) < 12 THEN
Fato:
LOAD * FROM [$(vSmartTransformations)/Ebao/Fato/Fato.qvd] (qvd);
END IF
IF HOUR(NOW()) >= 12 AND HOUR(NOW()) < 19 THEN
Fato:
LOAD * FROM [$(vSmartTransformations)/SunDB/GM_SunDB_FINAL_Cocorretagem.qvd](qvd);
ELSE
T:LOAD * INLINE [
A,
1
];
END IF
EXIT SCRIPT;
Both scripts are very similar but not identically. Before assuming any bug or a file-corruption I suggest to check the script again very carefully, for example:
If nothing is obvious I would comment some parts and then the next and the next until you found the exact line/statement and quite often the mistake showed itself very clearly.
Hi Marcus,
Thanks for the reply. I posted the wrong print, look below the exactly same script in different app and the same result. This previous one was from another attempt.
I've already edit the original post with the correct prints.
Regards
Did you check the above mentioned points especially the last three?
Yes, I did. I've commented and run step by step, change to another qvd, remove the variables by include statement and tried by removing the automatically sets too.
With only the first part:
I've already did all these tips Marcus. Below and attached is the script, nothing else more.
IF HOUR(NOW()) > 4 AND HOUR(NOW()) < 12 THEN
Fato:
LOAD * FROM [lib://Smart BI Transformations/SunDB/GM_SunDB_FINAL_Cocorretagem.qvd](qvd);
END IF
EXIT SCRIPT;
This script is ok. I would now do the following testing:
What happens?
As I mentioned before, if I copy the same script and run it in a new app, it works. If I duplicate that app it won't work. I just modified the hour to 13 because of my time zone. See the prints below:
New app:
Duplicated app
The app duplication was only meant to have a backup because all other script within the app should be deleted to exclude that it could cause any impact.
Beside that you may add another loads like:
t: load recno() as R autogenerate 1;
below your qvd-load within the if-loop and then a second time after the if-loop. Also you may try to remove the exit script; statement.
Another attempt would be to set the ERRORMODE to ignore any error, like:
set ErrorMode=0;
What happens now?