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: 
Not applicable

Change dimension based on selected expression

Hi there,

I have a bar chart for which I have 4 dimensions and 4 expressions. Lets give them random names before I start describing my problem (screen shots have the real names I have used)

Dimensions   Expressions

DimA             ExpA

DimB             ExpB

DimC             ExpC

DimD             ExpD

Note: Dimensions are cyclic grouped and Expressions are also cyclic grouped (Please see attached screen shots)

DimA - formula used is =Aggr(DISTINCT ROUND(DimA, .1), DimA)

ExpA - formula used is =Count(ROUND(DimA, .1))

The same formula applies to all other dimensions and expressions (Only the dimension and expression names change in the formula).

Apparently, currently the users when they select ExpA then they must select DimA to see the correct results in the graph. Similary if they select ExpB then DimB must be selected to see the correct results.

This is a bit annoying sometimes and I wanted to know if there is a way by which I can achieve the following

1. Whenver user selects an ExpA automatically DimA must be selected.

2. Above must apply to all other expressions.

3. Show only the result of one selected expression (with one dimension) at a time.

Is this doable in any way?

Thanks,

Ranjith

1 Solution

Accepted Solutions
MayilVahanan

Hi

Check the attached file..

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

12 Replies
jagan
Luminary Alumni
Luminary Alumni

Hi Ranjith,

By using GetCurrentField(), we can get the selected dimension in a Group.  By getting the dimension, using If() in expression you can achieve this in a single expression like below

=If(GetCurrentField(GroupName) = 'Dimension1', Expression1,

     if(GetCurrentField(GroupName) = 'Dimension2', Expression2,

          if(GetCurrentField(GroupName) = 'Dimension3', Expression3, Expression4)))

Hope this helps you.

Now you don't need four expression, single dynamic expression serves your purpose.

Regards,

Jagan.

   

Not applicable
Author

Hi Jagan,

Thanks for the response but I'm afraid this will not work for me. The reason being GetCurrentField() only works if the group contains fields whereas mine consists of formula's (please check my first post above).

RC

Not applicable
Author

Hi Ranjith,

What version of QV do you use?

If you use QV 11 you can easily do this by enabling the condition.

Thanks,

Srini.

Not applicable
Author

I use QV11. Can you please attach an example of how to do this in my case please where the dimensions and expressions are groups and then each field is a calculated one?

Not applicable
Author

Hi Ranjith,

Provide me a sample document with sample data.

Thanks,

Srini.

Not applicable
Author

Attached.

Not applicable
Author

Ppl,

Any answers? Is there a way possible?

MayilVahanan

Hi

Check the attached file..

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

Great. Thanks MV. That solved it.