Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
kamal_sanguri
Specialist
Specialist

how to use variable in dimension field

Hi,

I am trying to create a Pivot Chart (Chart). So just thinking, If it is possible to use a variable to display dimensions.

The idea is to make it dynamic if any new field is added it should automatically be added to chart.

Any help would be greatly appreciated...

Thanks,

Kamal

2 Replies
vgutkovsky
Master II
Master II

Suppose you have a field called MyField. You can create a variable called vField and set it to MyField. You can then create a calculated dimension: $(=vField). By changing the value of vField, you can switch different dimensions.

Similarly, you can accomplish the same thing by creating an island dimension and then picking the desired field. For instance, you could create an island field called AllFields which would contain the names of all fields you'd like to display. If a user selects a single value of AllFields, you can dynamically set that as the chart dimension by creating the following calculated dimension: $(=AllFields)

However, what you cannot do, is dynamically define the number of dimensions. You'd need to create one of these calculated dimensions for every dimension you'd like to display. For instance, if you want your chart to have 3 dimensions, you'd need 3 calculated fields.

Alternatively, if you know in advance that you want only certain fields to be possible dimensions, you can just make them regular dimensions and enable/disable them conditionally on the Dimensions tab.

Hope that helps.

Vlad

ecolomer
Master II
Master II

Here you have a simple example

If you add a line in INLINE file ... example:

Rusia, Bike, Yes o you change in the las record    Rusia, Bus, No by Rusia, Bus, Yes ... appear a new column in the graphic