Have you ever had a filter that should be interpreted differently on each sheet? We are building a QlikView document to analyze case management. On sheets that describe initial response time, the date filter should affect open dates. On sheets that describe resolution time, the date filter should affect close dates. Displaying all possible filter combinations quickly became a frustrating user experience.
The solution: create contexts. In the Edit Script, we continue to load the case data once, but then we use LOAD … RESIDENT to create specific contexts of the data. For example:
LOAD case_nbr, *;
SQL SELECT * FROM case_data;
LOAD case_nbr, open_date AS SelectedDate, 'Opened' AS Context
LOAD case_nbr, close_date AS SelectedDate, 'Closed' AS Context
Now, the UI can simply expose "SelectedDate" in a list box and each sheet has a trigger like Context="Opened" or Context="Closed". Users don't have to clear their selections between sheets, the filter stays the same; only the context of what the date is applied to changes.
Thank you, Fernando. I stopped exposing open date and close date for selection and replaced them with a single SelectedDate. Then I added a sheet open trigger to set Context appropriately. That way if a manager wants to report for the month, they select the right date(s) and other criteria like product and workgroup. As they click tabs, the Context value is switched, but the other filters remain. So when they select May 2010 and are looking at response rates, May 2010 is in the context of opened cases. When they click the resolution tab, May 2010 is in the context of closed cases. No conditional calculations necessary.
I have several applications that manage multiple dates in this way as well. In my case, the users select the context manually, because it isn't specific to each sheet, but rather specific to the kind of analysis they're doing. But it's the same idea. I think it's a very good solution as long as your users never need to select only cases opened in May AND closed in June.