Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Changing cycle group by changing an other cycle group in different charts

Hello community!

I have a question concerning cycle groups in charts.

I created two different cycle groups and added them into two different charts. If a user changes the dimension of a cycle group in one chart, I like to change the other dimension of the cycle group in the other chart automatically. Is it possible to implement this? If yes, how can i do it? Trigger? Macro? Script?

Has anyone a suggestion for me?

As note I tried something like

=if(GetCurrentField('cycleGroupName1') = 'cycleGroupName1Value', GetCurrentField('cycleGroupName2') = 'cycleGroupName2Value')

chose document properties-> triggers -> OnPostReduceData -> Add action -> Selection -> Selection in Field

I also tried to define my condition in the charts but wont work.

Thanks in advance for helping me!

Best regards!

Carl Reinisch

1 Solution

Accepted Solutions
swuehl
MVP
MVP

So what do you get returned from your calculated dimension?

Please check that GetCurrentField() returns the current field of your group, I am always confused with the mixed-up requirement to pass a string or a field / group name in QV, but I believe you should remove the single quotes within the GetCurrentField() function.

=if(GetCurrentField( Größenklasse ) = 'Bedarfsgrößenklasse', Bedarfszielgruppe,

(If(GetCurrentField( Größenklasse ) = 'Stat.Größenklasse', Stat.Zielgruppe)))

View solution in original post

5 Replies
Anonymous
Not applicable
Author

Carl,

I assume that your cycle groups are not identical, otherwise you can use only one in both charts.
Assuming that the group 1 has fields A,B,C - use it in Cycle in the 1st chart.
In the second chart, use calculated dimension, something like
=if(GetCurrentField('cycleGroupName1') = 'A', X, if(...)))

No triggers/macros/actions needed.

(I didn't try, but expect this approach to work.)

Regards,
Michael

Not applicable
Author

Hello Michael!

Thank you for your quick answer, but it didn't give me the expected results.

As you said, I used a calculated dimension:

As note:

- "Bedarfszielgruppe" and "Stat.Zielgruppe" are both dimensions

- my cycle group is called "Größenklasse" and has two values "Bedarfsgrößenklasse" and "Stat.Größenklasse". If "Bedarfsgrößenklasse" is chosen, i'd like to change my calculated dimension to "Bedarfszielgruppe" else i'd like to change it to "Stat.Zielgruppe".

My code:

=if(GetCurrentField('Größenklasse') = 'Bedarfsgrößenklasse', Bedarfszielgruppe, (If(GetCurrentField('Größenklasse') = 'Stat.Größenklasse', Stat.Zielgruppe)))

As formula i used "count(distinct customerID)"

Perhaps you have another solution to solve my problem.

Thanks a lot!

Regards,

Carl

swuehl
MVP
MVP

So what do you get returned from your calculated dimension?

Please check that GetCurrentField() returns the current field of your group, I am always confused with the mixed-up requirement to pass a string or a field / group name in QV, but I believe you should remove the single quotes within the GetCurrentField() function.

=if(GetCurrentField( Größenklasse ) = 'Bedarfsgrößenklasse', Bedarfszielgruppe,

(If(GetCurrentField( Größenklasse ) = 'Stat.Größenklasse', Stat.Zielgruppe)))

Anonymous
Not applicable
Author

Is it absolutely necessary to use Cycle group?  If not, it is easier to use a variable with pre-defined values, and make dimension calculated in both charts, and depend on the same variable.

See attached.  I'm sure it can be done in a more elegant way, this is just a quick demo.

Regards,

Michael

Not applicable
Author

Thanks swuehl for your help! You're right, the mistake was only the single quotes within the GetCurrentField() function. Now it works very well!

@Michael, yes it is necessary to use the cycle group.

Thanks both of you again for helping me!

Regards,

Carl