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: 
ali_hijazi
Partner - Master II
Partner - Master II

alternate state! is this a bug?

hello

got QVW SR8

I have a variable vFromDate

i'm giving it values on document triggers on select and on change of two fields (Month and Year)

now I added an alternate state and give it to a list box for the field OFFICIAL

why the selection on the list box with an alternate state shall change the value of vFromDate

please check attached

clear

then select N or Y from OFFICIAL list box on the right (alternate state Group1)

please advise

I can walk on water when it freezes
1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Ok, I see the problem when I add in the selection of 2104. No bug, just a change required.

A selection in the [GROUP1] OFFICIAL listbox does indeed cause a change in Month. You have defined an OnChange trigger for Month, which fires as expected. In your computation of the SetVariable value, your expression does not contain a Set ID, therefore the expression uses data from the inherited GROUP1 state. Change your expression to explicitly reference the Default group which is where you want to get your CALENDAR_DATE value from.

=num(daystart(Yearstart(date(min( {$<RECORD_TYPE={'waste'}>} CALENDAR_DATE)))))

-Rob

http://masterssummit.com

http://robwunderlich.com

View solution in original post

4 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I can't recreate the problem from your example file.

-Rob

ali_hijazi
Partner - Master II
Partner - Master II
Author

may you please clear selections first, then select 2014 from the year list box finally there is a list box on the right side having an alternate state defined

select any value and you will see how the value of the variable vFromDate changes

I can walk on water when it freezes
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Ok, I see the problem when I add in the selection of 2104. No bug, just a change required.

A selection in the [GROUP1] OFFICIAL listbox does indeed cause a change in Month. You have defined an OnChange trigger for Month, which fires as expected. In your computation of the SetVariable value, your expression does not contain a Set ID, therefore the expression uses data from the inherited GROUP1 state. Change your expression to explicitly reference the Default group which is where you want to get your CALENDAR_DATE value from.

=num(daystart(Yearstart(date(min( {$<RECORD_TYPE={'waste'}>} CALENDAR_DATE)))))

-Rob

http://masterssummit.com

http://robwunderlich.com

ali_hijazi
Partner - Master II
Partner - Master II
Author

well yes you are right

it works now

thank you very much indeed

I can walk on water when it freezes