Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Dynamic Titles in Charts

I have created a chart with cycling expressions. One expression shows the total time of some field. The other expression shows the average time of some field. I would like the title to be "Total Time" or "Average Time" depending on which expression is cycled.

So far, I have been unsuccessful in searching for a solution to this problem and the getfieldselection option doesn't seem to me to work here. Can someone please give me some insight into this problem? Thank you.

8 Replies
ecolomer
Master II
Master II

In the definition of Groups, you can write in the LABEL the name as you need show itp15.png

Anonymous
Not applicable
Author

You may need to use the getcurrentfield() function in an expression for your label.

Help entry pasted below :

getcurrentfield (GroupName)

Returns the name of the currently active field in a group.

Example

getcurrentfield( myGroup )

Not applicable
Author

Attaching the sample qvw with expected output.

You don't have to use any special functions to get the required results.

Not applicable
Author

try something like this:

add a text box above your chart and try this expression

If(SubStringCount(GetCurrentField([cant-Imp]))>0,'Total Time','Average Time')

modify this expression as per your requirement

e.g

If(SubStringCount(right(left(trim(GetCurrentField([cant-Imp])),65),10),'Total Time')>0,'Total Time','Average Time')

Hope it helps

jonathandienst
Partner - Champion III
Partner - Champion III

Do you mean that you clicked the Group button on the Expressions tab? GetCurrentField only works for dimension groups AFAIK. If you create a label for each expression, the column header will change when you cycle. For a chart, if you enable "Show Title in Chart", the title will follow the cyclic label.

But I don't think that there is any way to get the cyclic expression label to the caption for a table..

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable
Author

... except if you use the getcurrentfield() function in a Caption expression.

Not applicable
Author

Thank you for the responses and the file. My personal edition will not allow me to recover this file so I cannot see it.

Let me clarify my original question. I know how to label an expression. Please reference the two photos below. They are of the same chart. The first chart has an expression for the total time. The second photo shows the same chart cycled to show the average time. Notice that the title of the chart has not changed. This is what I want to update as the end user cycles the expressions.

Sorry for not being clear earlier.

total.JPGaverage.JPG

Anonymous
Not applicable
Author

Aaahhh !!!    I think i understand the question now.

What I would do is give up with the expression cycle, and instead :

  • Create a Text Object with Actions to set a variable to say 'ExpA' or 'ExpB'
  • Make the 2 expressions conditional on the variable value.
  • Make a suitable Title expression using the variable value.