Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have a document, in it there is a table that contains Dates in various forms (IE: Date, Calander Month, Calander Year,Calander Week, Financial Year, Financial Month... etc)
There are OnChange Event triggers on these fields to capture selections and change the value of 2 variables.
Like so:
v_filter_DateRangeStart= Min(<DateSelected>)
v_filter_DateRangeEnd= Max(<DateSelected>)
When these variables are changed, there is a trigger which sets the filter of the document to be "='>=' & Date(v_filter_DateRangeStart) & '<=' & Date(v_filter_DateRangeEnd)"
In the filters section of the document we have tableboxes for the fields in the date table, the idea, and how it works in the first document, is that when a selection is made in the year box (for example) this then triggers a change in the variables (v_filter_DateRangeStart, v_filter_DateRangeEnd) which in turn changes the filter on the target date field as above. There are also some input boxes which allow direct input into the variables (v_filter_DateRangeStart, v_filter_DateRangeEnd).
When typing a date into the input box, the document filters as expected. However the variables to not change when trying to use the table boxes, as it does in the other document.
I have looked everywhere i can to make sure that the document properties etc match, but there seems to be something i have missed/have forgotten.
Since creating the original document we have upgraded from QV 10 to 11.2, was somethign stopped here to forbid chaining triggers? or is there a setting somewhere which may have been turned off that i need to reactivate?
any help would be greatly recieved.
Thank you,
Chris
You have constraints on the variables. The field [Lookup Date] is formatted as a number and not a date. You need to wrap the triggers in date() in order to get them to work:
I've also attached a working example for the [Week (Calendar)] field.
You can't trust QV that the triggers are happening in the order you have set them in. Maybe try changing the trigger to the following so that it isn't dependent on previous triggers:
='>=' & Date(Min(<DateSelected>)) & '<=' & Date(Max(<DateSelected>))
If this works, you know things just aren't happening in the order you expect them to in the back end.
i have seen the same issue too...Try this trick....
Place two text boxes with your variables as expressions..
=v_filter_DateRangeStart
=v_filter_DateRangeEnd
And hide them by shrinking the size..or placing some where behind...
Do not hide using a invalid condition in "layout --> Show"
I don't see how the order could be getting confused... but then i have given up trying to understand qlikview! i will give this ago. Simplifying the chained triggers is probably not a bad idea anyway, as this was originally developed to allow for the user to change the date the user wishes to filter on.
I will also try that trick, which again makes no sense to my simple brain, as keeping the functionality would be nice.
i will play following the advice, and get back to you, marking helpful and correct etc
Thanks! both
I know...some times i feel the same too...
Also make sure your text boxes should show the value not Min(Dateselecte) or Max(Dateselected) text...
if it shows text place equal and dollar sign..
=$(v_filter_DateRangeStart)
I have tried this and played around trying to get it to work, but it just doesnt look like the trigger is firing at all.
As you recommended, i simplified the trigger.
There is only one event on the field "Calander Year" for OnChange and that is exactly what is written (and working) ont he OnChange event of the variable, Yet nothing. I added to the "OnSelect" event, and nothing happens either.
So still no luck 😕
I am not sure if there is something i am not doing, or steps that may have been missed, but this doesnt seem to have made a difference
Can you post a .qvw?
Preparing examples for Upload - Reduction and Data Scrambling
Hopefully this will be enough to give you an idea. due to strict IG rules (as we are a hospital!) i have limited the load to 10 records per table, and scrambled anythign that could identify a patient.
Here is the scambled and limited file. You may have to navigate to the date filter section (apologies, but if igured you wold want to see this as close to "natural") Click "Theatres Dashboard" and then "Show Filters" and you will be on the filters screen.
Below the left hand menu is a text object displaying the current date range selected, that is a good sign to see what the filters are doing.
If the date boxes dont show (the ones with the silver header bar) then you may need to reset "v_filter_Tab" to 1.