Skip to main content
Announcements
Qlik Community Office Hours, March 20th. Former Talend Community users, ask your questions live. SIGN UP
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Creating contexts to simplify complicated filters

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:

CaseData:

LOAD case_nbr, *;

SQL SELECT * FROM case_data;

LOAD case_nbr, open_date AS SelectedDate, 'Opened' AS Context

RESIDENT CaseData;

LOAD case_nbr, close_date AS SelectedDate, 'Closed' AS Context

RESIDENT CaseData;

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.

3 Replies
fernandotoledo
Partner - Specialist
Partner - Specialist

Nice solution!

Do you use the Context field only in selection, then force the user to select it by conditional calculation?

Best Regard,

Fernando

Not applicable
Author

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.

Best regards,

James

johnw
Champion III
Champion III

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.