I have data that looks something like this:
|Location||Weekday visitors||Weekend visitors||Weekday sales||Weekend Sales|
I would like to be able to have a single chart table that shows all the locations, but displays either the Weekday stats or the weekend stats based based on a user selection.
So it would be something like this:
(some way for a user to select between the two)
Is this possible? Perhaps I need to do something when I load the data?
yes, you can do it if you load an extra field "Measure" with the possible values like "Weekday Stats" and "Weekend Stats", and let users select the value from a Filter.
In the chart, have a conditional expression that shows one formula or another, based on the selected value.
Check out my new book QlikView Your Business - The Expert Guide for QlikView and Qlik Sense
Check the attached
(html, codepage is 1252, embedded labels, table is @1);
LOAD * Inline "
Field, Visitor, Sales
WeekDay, Sum([Weekday visitors]), Sum([Weekday sales])
WeekEnd, Sum([Weekend visitors]), Sum([Weekend Sales])
"Weekday visitors" as Visitors,
"Weekday sales" as Sales,
'Weekday stats' as type
"Weekend visitors" as Visitors,
"Weekend sales" as Sales,
'Weekend stats' as type
Well, just saw that it is Qlik Sense. Not sure if this will work in Sense or not
UPDATE: Seemed to have worked (with the only problem that we don't have the option to make the filter box have 'Always One Selected Value'). This might become an issue when user selects both weekday and weekend in the field filter.
But check it out
Qlik by default allows multiple selection.If you have to restrict to have a single selection, then it would be better if you have toggle buttons which is an extension. Check Qlik branch if you can find an extension for this.