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

Announcements
Save an extra $150 Dec 1–7 with code CYBERWEEK - stackable with early bird savings: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
hugmarcel
Specialist
Specialist

How to refer the dimension name?

Hi

I have a dimension with name "Prio" in my pivot, and I want to make it conditional, e.g, it should only be shown when user selects "prio" in a listbox.

Is it possible to make this more generic, avoiding any strings in the condition formula. E.g. set as condition:

If (<getDimensionName()> = getSelectedField(listbox), 1, 0), where getDimensionName refers the dimension.

Check as well http://community.qlik.com/message/204773#204773 asking the same...

Thx - Marcel

1 Reply
hugmarcel
Specialist
Specialist
Author

Hi

a possible solution or alternative is to create the dimension name upon user selection. Therefore, no
<getDymensionName()> function will be needed:

1.) Put all possible dimensions and their combinations into a list box:


    ("Office", "Salesman", "Office, Salesman", "Salesman, Office") etc.


2.) Select 1 value in the listbox.


3.) In a Pivot, create dynamic dimensions such as:

      =$(=(SubField(GetFieldSelections(DIMENSION),',',1)))
      =$(=(SubField(GetFieldSelections(DIMENSION),',',2)))
      ...
      =$(=(SubField(GetFieldSelections(DIMENSION),',',n)))

      etc.

4.) Set the dynamic dimensions to conditional with

    =len(Subfield(GetFieldSelections(DIMENSION),',',1))
    ...
    =len(Subfield(GetFieldSelections(DIMENSION),',',n))
   
Marcel