Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
EHrsa
Partner - Contributor
Partner - Contributor

how to use dimension master item, in a variable for a dynamic dimension

I have a master dimension 

Company Name ={<[Entity Category]={"Company"}>} [Entity Name]

which only show values when the Entity Category = Company.

this works fine if I create a bar chart with dimension = [Company Name] and measure = sum(sales)

I put the list of dimension master items in a table [DimList] and field DimField

[DimList]

DimField

Company Name

Producer Name

Buyer Name

and created a variable vSelectedDim = GetFieldSelections(DimField)

now if I create a bar chart dimension using $(vSelectedDim) i got error in expression. I even tried using =$(=$(vSelectedDim)).  Also tried renaming the DimField as "Company Name" and [Company Name] still does not work.  

Can you help me with the proper formula to make this work. 

Thank you.

Labels (5)
2 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi there,

I think you have too many $-sign expansions. I'd try something like this:

=[$(vSelectedDim)]

Also, for troubleshooting, you should be able to see what this formula resolves to, at the bottom of your expression editor. Perhaps you could find out the "disconnect" in the chain of settings.

Cheers,

EHrsa
Partner - Contributor
Partner - Contributor
Author

=[$(vSelectedDim)]

this works only if vSelectedDim reference a field and not a master item, i got error in expression when the result of [$(vSelectedDim)] is [Company Name]