12 Replies Latest reply: Mar 18, 2015 11:15 PM by Manie Ye

# 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

• ###### Re: Change dimension based on selected expression

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.

• ###### Re: Change dimension based on selected expression

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

• ###### Re: Change dimension based on selected expression

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.

• ###### Re: Change dimension based on selected expression

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?

• ###### Re: Change dimension based on selected expression

Hi Ranjith,

Provide me a sample document with sample data.

Thanks,

Srini.

• ###### Re: Change dimension based on selected expression

Attached.

• ###### Re: Change dimension based on selected expression

Ppl,

Any answers? Is there a way possible?

• ###### Re: Change dimension based on selected expression

Hi

Check the attached file..

• ###### Re: Change dimension based on selected expression

Great. Thanks MV. That solved it.

• ###### Re: Change dimension based on selected expression

Mayil:

I have the same issue.

I don't see your attached file..can you pls attach it.

• ###### Re: Change dimension based on selected expression

i can't see your attach file tooooo but i do really need you example~~ could you please send me the attachment???

• ###### Re: Change dimension based on selected expression

Hi,

Actually i have same requirement. If i select one expression then i should get the respective dimension value so that i can pass same thing through button to navigate to other sheet....

So do we have have any method by which i can which expression and corresponding dimension selected ?