Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
ali_hijazi
Partner - Master II
Partner - Master II

Triggers on Alternate State

Hello

Got a document in which the selection on the Date field sets a variable called vFromDate to a value = num(daystart(monthEnd(Date))

now I got the same list box for Date but put in an alternating state called MAIN

I want the selection on this list box to set the same variable vFromDAte to the same expression but calculated in state MAIN

I added another action and selected the STATE MAIN but the variable vFromDATE only changes on the inherited state

Please advise

I can walk on water when it freezes
6 Replies
swuehl
MVP
MVP

Try as variable definition

num(daystart(monthEnd(only({MAIN} Date)))

ali_hijazi
Partner - Master II
Partner - Master II
Author

I did but it didn't work

it is changed only selections made on original state

I can walk on water when it freezes
swuehl
MVP
MVP

If I test a OnSelect trigger, it's getting fired also when selecting on a field list box in alternate state.

I am on 11.20 SR11, which version are you running.

ali_hijazi
Partner - Master II
Partner - Master II
Author

I'm using 11.2 SR8

I can walk on water when it freezes
ali_hijazi
Partner - Master II
Partner - Master II
Author

what I want is to give different values for the same variable depending on the selection made on Date in the diverse states

if in original state I select 2014 feb the variable should take feb 2014

whereas if I select 2015 feb from the list box which got an alternate state I want the same variable to take feb 2015

knowing that the 2 listboxes are in different tabs (sheets)

I can walk on water when it freezes
swuehl
MVP
MVP

I currently don't know how this should work out.

Maybe you can do it another way: Create an OnActivate sheet trigger for both sheets that is setting the variabel to either

='=num(daystart(monthEnd(Date))'

or

='=num(daystart(monthEnd(only({MAIN} Date)))'


So you are using two different definitions for your single variable depending on the sheet you are working.