OnSelect Field Event triggers when clearing another field?
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!
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?
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.