Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

giakoum
Honored Contributor 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
Honored Contributor II

Re: OnChange or OnSelect previous value

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

2 Replies
sushil353
Honored Contributor II

Re: OnChange or OnSelect previous value

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
Honored Contributor II

Re: OnChange or OnSelect previous value

OK got it now!

It works with OnSelect

Thank you!

Community Browser