Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Variable as dimension

Hey there,

I want to see some of my variables in combination with other fields in one dimension for an table (as shown in the example)

Maybe somebody has an idea?

Thank you Tina

9 Replies
vishsaggi
Champion III
Champion III

May be this see attached.

Use a straight table here.

Like add dim: Value_field

Expr:

= IF( Value_field = 'profit',profit,

  IF( Value_field = 'Sales_margin', [sales margin], Sum(Value)))

Anonymous
Not applicable
Author

Hey

Thank you for your answer!

It works! But if I select now a other field like for example a region, the variables disappear. (see attached)

I dont know how to solve that problem!

vishsaggi
Champion III
Champion III

What is that you want to see when you click on the region? I mean you want to see the values 15 and 2 in your profit and Sales_margin or 0's for these values?

Anonymous
Not applicable
Author

No I wanna see the values, that only belong to the selected region.

So for Nord 6 for Sales Margin and 2,5 for profit!

Thank you

vishsaggi
Champion III
Champion III

Ok will look into it. If not may be stalwar1‌ can help on this.

sunny_talwar

May be try this

= IF(Only({1}Value_field) = 'profit',profit,

  IF(Only({1}Value_field) = 'Sales_margin', [sales margin], Sum(Value)))

vishsaggi
Champion III
Champion III

Superb. Cant believe completely forgot about this Only().

Anonymous
Not applicable
Author

Thank you
The selecting of the regions is now working!

So one more question: If I have two different years now in my data and I wanna show only one year in one of the table columns, how can I manage to do this? Because if I put an set analaysis or an "and" in the if-function it of course only shows me 0.

For the sum-function in the end, it works of course with a simple set analysis.

= IF(Only({1}Value_field) = 'profit',profit,

  IF(Only({1}Value_field) = 'Sales_margin', [sales margin], Sum({<Year={'2017'}>}Value)))

sunny_talwar

Where exactly do you see 0? Can you elaborate?

Capture.PNG