Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Donthamsetty10
Contributor II
Contributor II

Dynamic titles for same bar graph with diff alternative Dimensions

How to print to different titles for two diff alternative dimensions /measures in a same bar graph.

" In 1st graph I have selected employees department and no. of employees And i want to give title as "No. of employees in each dept"  . And in the same bar graph I have selected another alternative dimension for Employees Sales Office, and i want to give title as "No. of employees in sales offices" ".

pls help me with expression

I have used below code and got error

= If( GetObjectField(Title)
'No. of Employees in each Department' ,
If( GetObjectField(SalesOffice),
'No. of Employees in each Office'
))

Screenshot 2022-10-25 at 3.36.40 PM.png

Labels (2)
3 Replies
brunobertels
Master
Master

hi 

as far as i know you can't use getObjectfield with alternative dimension 

i would advise to create a variable button let's call it vTypePlace 

0 for departement

1 for office 

then in dimension $(vTypePlace) 

and for title if($(vTypePlace= 0 , 'No. of Employees in each Department' ,'No. of Employees in each Office')

hope it helps 

Donthamsetty10
Contributor II
Contributor II
Author

May I know where to create button? From charts ?

brunobertels
Master
Master

hi 

 

create variable from the variable panel here : 

brunobertels_1-1666709290425.png

name it vTypePlace 

 

set 0 a default value 

brunobertels_2-1666709371933.png

clic on create variable 

then here 

add on your page this object 

 

brunobertels_0-1666709219681.png

 

here  : 

brunobertels_3-1666709541911.png

give a title to your object 

select the vTypePlace you created 

show as button 

select display 

values : keep fixed 

clic Add Alternative :

value 0 

Label Office 

clic Add alternative 

Value 1 

Label Departement

brunobertels_4-1666709701054.png

 

once it is done 

in your chart supress alternative Dim and replace Dim by this mesure 

if($(vTypePlace)=0, SalesOffice , Title)

and in the chart title 

if($(vTypePlace)=0, 'No. of Employees in each Office',  'No. of Employees in each Department')

 

I hope i forget nothink 

Regards