Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
giakoum
Partner - Master II
Partner - Master II

OnChange or OnSelect previous value

Hi fellow QlikView addicts.

When the user is selecting some value in a list box, I want to check that value and restore the previous selection if the check fails. Creating a macro for the checking was easy, but how can I restore the previous value? Bookmark or saving it to a variable does not seem possible as it looks like that when the macro runs, the new value has already been selected.

Any ideas would be really appreciated.

Thank you.

1 Solution

Accepted Solutions
sushil353
Master II
Master II

Hello,

we can save the pervious selection in a variable using:  =Only({$1}Person)

here Person is my field it will always save the previous value..

Now the idea is: when you checked your current selection you can eaisly change some variable value depending on the pass or fail

lets say if the current selection is ok then vSelection is 1 else 0

now put a trigger on variable> on value chage > selections in field and in search string if(vselection=1,vCurrent,vPrevious)

vCurrent: =only(Person)

vPrevious= only({$1} Person)

HTH

Sushil

View solution in original post

2 Replies
sushil353
Master II
Master II

Hello,

we can save the pervious selection in a variable using:  =Only({$1}Person)

here Person is my field it will always save the previous value..

Now the idea is: when you checked your current selection you can eaisly change some variable value depending on the pass or fail

lets say if the current selection is ok then vSelection is 1 else 0

now put a trigger on variable> on value chage > selections in field and in search string if(vselection=1,vCurrent,vPrevious)

vCurrent: =only(Person)

vPrevious= only({$1} Person)

HTH

Sushil

giakoum
Partner - Master II
Partner - Master II
Author

OK got it now!

It works with OnSelect

Thank you!