Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
ananyaghosh
Creator III
Creator III

Alternate dimension in Qlik Sense -- need help

Hi,

The dynamic dimension name in chart Title is  possible if you are using Alternate dimension in Qlik Sense?

Thanks,

Sandip Ghosh

1 Solution

Accepted Solutions
ananyaghosh
Creator III
Creator III
Author

Hi,

Thank you very much for your help. I just implement this using the below code:-

in Script:-

[Dimension]:

load * inline [

DimensionID, Dimension

1, Category

2, Country

3, City

];

and use 'Dimension' field as a filter drop down.

after that we need to use the below code at chart title:-

='Dimension By ' & ' ' & if(GetSelectedCount(Dimension) =0, 'Category', pick(match([DimensionID],'1','2','3'),

'Category',

'Country',

'City'

))

and in the dimension filed we need to use the below code:-

=if(GetSelectedCount(Dimension) =0, Category, pick(match([DimensionID],'1','2','3'),

Category,

Country,

City

))

and in the dimension label we need to use the below code:-

=if(GetSelectedCount(Dimension) =0, Category, pick(match([Dimension],'1','2','3'),

'Category',

'Country',

'City'

))

where 'Category', 'Country', 'City' are the filed names that will be shown like this:-

Thanks,

Sandip Ghosh

View solution in original post

4 Replies
OmarBenSalem
Partner - Champion II
Partner - Champion II

Nope; that's not possible;

But u want to show it in the title; I would suggest u not to use alternative dimension but rather do as follow:

- go to script, and create an inline table :

load * inline [

DimensionID, Dimension

1, Dim1

2, Dim2

];


- Now in ur sheet, above ur chart, add this new Dimension field as a filter

- In ur chart, instead of using alternative dimensions; use a calculated dimension as follow:

if(DimensionID=1, YourFirstDimension, YourSecondDimension)

-Now, in the title , u add this information to know which dimension we're working with

='My measure by '&Dimension


ps: u can add in the adds-on, to force users to select only one dimension: Count(Distinct Dimension)=1


Or, as a filter, use an extension and not the native Sense filter object, to force the user to be able to select only one Dimension:

example:

http://branch.qlik.com/#!/project/5702b378bf1c421463412c90

ananyaghosh
Creator III
Creator III
Author

Hi,

Thank you very much for your help. I just implement this using the below code:-

in Script:-

[Dimension]:

load * inline [

DimensionID, Dimension

1, Category

2, Country

3, City

];

and use 'Dimension' field as a filter drop down.

after that we need to use the below code at chart title:-

='Dimension By ' & ' ' & if(GetSelectedCount(Dimension) =0, 'Category', pick(match([DimensionID],'1','2','3'),

'Category',

'Country',

'City'

))

and in the dimension filed we need to use the below code:-

=if(GetSelectedCount(Dimension) =0, Category, pick(match([DimensionID],'1','2','3'),

Category,

Country,

City

))

and in the dimension label we need to use the below code:-

=if(GetSelectedCount(Dimension) =0, Category, pick(match([Dimension],'1','2','3'),

'Category',

'Country',

'City'

))

where 'Category', 'Country', 'City' are the filed names that will be shown like this:-

Thanks,

Sandip Ghosh

OmarBenSalem
Partner - Champion II
Partner - Champion II

Good  but that makes my answer correct (just kidding)

ananyaghosh
Creator III
Creator III
Author

yes, of course you are correct.