Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor II
Contributor II

Dimension Variables with Measures Variables Button.

Hi ,

I have one table where I can put the measure  MTD and YTD on the selected button (find Screenshot)and have a state as a dimension. But the user wants selection on the dimension for example if the user wants to see MTD/YTD according to region, then the user wants a similar button like the MTD and YTD for selection Region and category. He wants when the select region, Region come replace of State, If the user clicks on Category region replace with category.  How I can write the condition on it. Currently, I am using this Condition

=IF($(Show)=0 ,Sum({<[Order Date]={">=$(=(MonthStart(Max([Order Date]))))<=$(=Max([Order Date]))"}>} Sales),

Sum({<[Order Date]={">=$(=(YearStart(Max([Order Date]))))<=$(=Max([Order Date]))"}>} Sales))

 

nituverma097_0-1592728083538.png

 

 

 

 

 

1 Solution

Accepted Solutions
Highlighted
MVP & Luminary
MVP & Luminary

In the button properties, where you are setting the value of the variable, you need to put Category into single quotes:

='Category'

That will put the word category into the variable, whereas without quotes it will look for the field called Category and get the result from here. With only one Category selected it will be the name of the category, with many it will return null.

Hope that helps.

Steve

View solution in original post

7 Replies
Highlighted
Partner
Partner

Hi,

I assume you are using the Variable button object from Qlik Dashboard bundle.

You can define values for each option in the dropdown. These values can be the names of the dimension fields.

Then, in the table, you put this expression for the dimension:

=[$(vDim)]

Replace vDim with the name of the variable you used in the Category/Region dropdown

Highlighted
MVP & Luminary
MVP & Luminary

Hi,

I've a Sense app where a list of dimensions is loaded from a spreadsheet and these can then be used in a drop down to pick dimensions for tables and charts. This video shows how it works:

You can download the app from here: https://www.quickintelligence.co.uk/isa

I'm also just putting the finishing touches on a blog post which describes how it is put together, my blog is here:
https://www.quickintelligence.co.uk/blog/

The post about the Instant Sense Application should be up in the next day or so. In the mean time this blog may prove useful: https://community.qlik.com/t5/Qlik-Sense-Documents-Videos/Create-a-Cycle-Group-in-Qlik-Sense-without...

Hope that helps.

Steve

Highlighted
Contributor II
Contributor II

Hi Fosuzuki,

Thank you for your revert. But I am not able to do this. It gives an error. Can you please explain your answer with an example, it will be good for me. Please help me where I am going wrong.

 

 

nituverma097_0-1592805861587.png

 

Highlighted
MVP & Luminary
MVP & Luminary

In the button properties, where you are setting the value of the variable, you need to put Category into single quotes:

='Category'

That will put the word category into the variable, whereas without quotes it will look for the field called Category and get the result from here. With only one Category selected it will be the name of the category, with many it will return null.

Hope that helps.

Steve

View solution in original post

Highlighted
Contributor II
Contributor II

Thank you Stevedark for the solution. 

Highlighted
Contributor II
Contributor II

Hi,

 

How can I get the dynamic title. For example if choose category (Select from button) then in dimension title show category, if select region then dimension title shows "Region" as a title.

Like this (find screenshot below.)

Please help me .

 

 

 

 

nituverma097_1-1596114478216.png

 

 

Highlighted
MVP & Luminary
MVP & Luminary

If you are placing either Region or Category as text into a variable you can set the button legend by using an expression like this:

='$(vDimension)'

The syntax for getting the content of a variable is called Dollar Sign Expansion, and if you Google this you should find a lot more information on how the syntax works.