Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Use variable's value as dimension in chart

Dear all,

I have a variable (v1) and its values I want to be the name of my dimension and then use this variable as a dimension in a a chart. How can I do this ??

For example:

I have 3 dimensions : D1,D2,D3 and 2 variables v1 and v2.

I want a box for each variable on which the user should select only one of D1,D2 or D3 and then use v1 and v2 in a chart's dimensions.

Thank you all

1 Solution

Accepted Solutions
Not applicable
Author

Dear Ioannis,

Thank you very much for you interesting. What I was needed was the expression :

=$(='['&v3&']')

and I wanted to use it on the expression tab of my chart. Have a nice vacation on our great island.

Your sincerely

View solution in original post

10 Replies
schlettig
Partner - Creator
Partner - Creator

Hi,

theres an example in here:

http://eu-a.demo.qlik.com/detail.aspx?appName=Credit%20Risk%20Management.qvw

See on tab Ad-Hoc.

You can download the qvw to see how it's done.

BR,

Christian

Anonymous
Not applicable
Author

Theofanis,

See attached.  Is it close enough to what you need?

Regards,

Michael

Not applicable
Author

Dear Michael,

Please could you describe me the solution in a few words because I have the Personal Edition and cant open the .qvw you sent me. Thank you in advance

giakoum
Partner - Master II
Partner - Master II

A really good solution from Michael (as always )

A more simple approach would be to have a list of dimensions in a list box (a data island) and use the Enable Conditional option in the dimensions tab in your charts to enable and disable them accordingly :

Capture.PNG.png

A nice expression to enable disable every dimension would be (D1 for example and assuming that the data island field is called %DimensionList):

Alt(

  WildMatch(GetFieldSelections(%DimensionList, '|') & '|', '*D1|*')

, 0)

schlettig
Partner - Creator
Partner - Creator

Hi,

you could use the example i posted below your first post, the file is personal edition enabled.

Due to moderation it took some time to show up.

Best regards,

Christian

Not applicable
Author

Hi Christian,

How can I download the demo app from qliktech? Can you please suggest.

Regards,

Srinivasu

schlettig
Partner - Creator
Partner - Creator

Hi Srinivasu,

you go to http://eu-a.demo.qlik.com/detail.aspx?appName=Credit%20Risk%20Management.qvw

You have to be logged in to see the demo download button.

Regards,

Christian

Not applicable
Author

Dear Ioannis,

Your post helped me a lot in order to solve my problem and I am very close to complete my project if you just help me with just a very simple expression. My workarround is the following:

I loaded a table with one column and its data is : 1,2,3,4 and with header AXIS.

I have changed the D1,D2,D3,D4 dimension names in 1,2,3,4 and also loaded them.

I created 3 input boxes with a variable in each one and the user selects with predifined values 1 - 4.

So the user can select for v1 = 1 , for v2=2 and for v3=3 for example.

In my chart now, on dimensions tab I used the expression you sent me : =$(=v1) and =$(=v2) and what I need is the expression for expression tab for v3. When I put the same expression, =$(=v3), it does not work. It cant read the number 3 as the name of the dimension but on the dimensions tab with this expressions =$(=v1) and =$(=v2) it works and shows me the numbers and I dont have the third number. Could you help me on the expression for v3 on the expression tab of the chart??

Yours sincerely,

Hatzis Theofanis

giakoum
Partner - Master II
Partner - Master II

Hi Theofanis.

sorry for a late reply, I am on vacation in Crete

Could you please post a sample?