Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

ananyaghosh
Contributor 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
Contributor III

Re: Alternate dimension in Qlik Sense -- need help

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

4 Replies
Highlighted
omarbensalem
Esteemed Contributor

Re: Alternate dimension in Qlik Sense -- need help

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
Contributor III

Re: Alternate dimension in Qlik Sense -- need help

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
Esteemed Contributor

Re: Alternate dimension in Qlik Sense -- need help

Good  but that makes my answer correct (just kidding)

ananyaghosh
Contributor III

Re: Alternate dimension in Qlik Sense -- need help

yes, of course you are correct.