Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
morganaaron
Specialist
Specialist

OnSelect Field Event triggers when clearing another field?

Hi all,

I've got a document that has a fiscal date calendar. It shows a fiscal period and fiscal year, and limits these values to only show the last 2 years of data, handled by variables that check against the current period/year and show whats available appropriately.

As there won't always be the same amount of periods available in each year due to this (i.e. if I'm in 2015 Period 2, this would show 2013 Period 3 onwards, so 2014 would have all periods but 2013 and 2014 would show 10 and 2 periods respectively), I put a Field Event Trigger "OnSelect" of the Fiscal Year so that when a year is selected, it automatically selects the first available period in that year - i.e. if I select 2014 it would go to Period 1, 2013 would go to Period 3.

My problem is that I have a number of other filters (like the name of a salesman) which when making a selection is no issue, but if you de-select what you'd picked (not change, only deselect so in essence clear that field) it resets the Period to the first available one, as if you have "selected" a fiscal year, even though this hasn't changed.

Any thoughts on why that's happening/how I could avoid it? ideally I'd want to be able to clear other fields and this not affect the period I'm viewing, it seems to be enacting the trigger on the Fiscal Year, which I don't want it to do. I tried changing this to be a Field Event "OnChange", but this stopped me from choosing any Period but the first available one!

Many thanks,

Aaron

4 Replies
tschullo
Creator III
Creator III

Hi Aaron,

I ran across the same problem and have not found an answer as to why this is.  It would be nice to know WHY this is happening if anyone out there in Qlik land knows.

Attached is a sample qvw that demonstrates this behavior.  The trigger is on Category and it toggles the text box variable between 1 and -1 "OnSelect" of Category.  If you select a sub category, the trigger is not affected, but when you deselect a sub category the trigger fires.

It sure would be nice to know WHY this happens. anyone from Qlik have an answer?

Thanks,

Tony Schullo

chriscammers
Partner - Specialist
Partner - Specialist

Have either of you contacted support about this? Feels like a bug. I just encountered it working with QV 11 SR5 and I am wondering if it was addressed in any more recent service releases.

Thanks

crystles
Partner - Creator III
Partner - Creator III

I'm thinking, with the "OnSelect" trigger, it IS actually selecting the year. So when you deselect the other selection, AFTER the OnSelect trigger has been triggered, then it is simply going back to the original state it was in. The trigger selected a year. So it's still selected.

chriscammers
Partner - Specialist
Partner - Specialist

I found a work-around for this but I don't think it will work if you have more than a handful of values in the field you want to base the trigger on.

I created a variable and an input box using a dropdown containing the same values I have poplulated in the field I was originally using for my trigger.

In the variable update event I set it to clear the desired selections and then select the matching value in the original field.

Now when I change the variable the selection on my original field changes but when I clear other fields the event does not fire because the value of the variable has not changed.

I hope that makes sense.

Chris