Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Show different fields based on a selection?

Hi,

I have data that looks something like this:

LocationWeekday visitorsWeekend visitorsWeekday salesWeekend Sales
A1234620
B1621103
C1532315
D1745825

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:

Weekday Stats

Weekend Stats

(some way for a user to select between the two)

LocationVisitorsSales
A126
B1610
C153
D178

Is this possible? Perhaps I need to do something when I load the data?

Thanks.

9 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Tanya,

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.

cheers,

Oleg Troyansky

Check out my new book QlikView Your Business - The Expert Guide for QlikView and Qlik Sense

sunny_talwar

Check the attached

Script:

Table:

LOAD Location,

     [Weekday visitors],

     [Weekend visitors],

     [Weekday sales],

     [Weekend Sales]

FROM

[https://community.qlik.com/thread/214279]

(html, codepage is 1252, embedded labels, table is @1);

Selection:

LOAD * Inline "

Field, Visitor, Sales

WeekDay, Sum([Weekday visitors]), Sum([Weekday sales])

WeekEnd, Sum([Weekend visitors]), Sum([Weekend Sales])

";

Straight Table

Dimension

Location

Expressions

1) =$(=Visitor)

2) =$(=Sales)


Capture.PNG

swuehl
MVP
MVP

Maybe like

LOAD

     Location,

     "Weekday visitors" as Visitors,

     "Weekday sales" as Sales,

     'Weekday stats' as type

FROM YourTableSource;

Concatenate

LOAD

     Location,

     "Weekend visitors" as Visitors,

     "Weekend sales" as Sales,

      'Weekend stats' as type

FROM YourTableSource;

sunny_talwar

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

Anonymous
Not applicable
Author

Thanks Sunny. This answered my question (except for the single selection part).

sunny_talwar

What is the single selection part?

Anonymous
Not applicable
Author

What you mentioned above - that it fails if the user selects multiple filter entries. I need some way to restrict this to a single selection.

sunny_talwar

May be reddys310‌ can help here

reddy-s
Master II
Master II

Hi Tanya,

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.