Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
jpengiu
Contributor III
Contributor III

Reload previous data

Hi all,

is possible to do a thing like this in a script?

if ......

reload previous data

else

select.....

end if

Thank all.

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Another way to say this is that for a server reload, if flag=0, you don't want to save the reloaded copy. You can do this by making the script fail with a syntax error.

IF flag=0 THEN

  fail me;  // Any invalid statement

ENDIF

The task will be in a failed status and the source and distributed copies will not get updated. The old content will be there for users.

-Rob

http://robwunderlich.com

View solution in original post

6 Replies
martin59
Specialist II
Specialist II

Yes it's possible :

IF condition THEN

     treatment;

ELSE

     treatment;

END IF

Hope that helps you

jpengiu
Contributor III
Contributor III
Author

I try to explain better..

I want to do a thing like this

if condition then

reload previous data (like when the script goes in error)

else

select   (my script)

end if;

It's possible?

Thank u.

martin59
Specialist II
Specialist II

I'm not sure to understand well.

If your script is wrong, you want to retrieve your old version ?

if that's you want, it's automatic when you check the option : "save automatically before reload"

jpengiu
Contributor III
Contributor III
Author

Sorry...i try to explain more better..

i have a table-check that say me if db sql datas are right or wrong.

If data are wrong i don't want to load them (i load  them in publisher) and i want to reload previous data (i wanto to mantain the qvw file non reloaded)

So i do this

If flag=0  (flag is the result of my table-check, flag=0 means that data,not scirpt, are wrong)

i want to reload previous data (data that are in qvw) LIKE when a script goes in error (when the script goes in error qlik ask me if i want to relod old data).

I hope u understand...sorry for my english!

Thank u so much.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Another way to say this is that for a server reload, if flag=0, you don't want to save the reloaded copy. You can do this by making the script fail with a syntax error.

IF flag=0 THEN

  fail me;  // Any invalid statement

ENDIF

The task will be in a failed status and the source and distributed copies will not get updated. The old content will be there for users.

-Rob

http://robwunderlich.com

jpengiu
Contributor III
Contributor III
Author

I'm a stupid.....

Thank you so much!