Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
apoorvasd
Creator II
Creator II

Dynamic Labels for bar chart

Hello Everyone,

I would like to have a dynamic labels for my chart. What I mean is, when I select a week or a month which is less than current month, then the label should display, "Thereof BB" and if the month or week selected is greater than or equal to current month then the label of the bar should display ,"Risk BB" . With the below mentioned expression I am getting to work this except that, when I select more than one past or future month, it is not working.

=if(GetFieldSelections(WeekShort)>=month(Date#(WeekShort,'MMM')) or  Month(Date#(POPER_NEW, 'MMM'))>=month(today()) 

,'Risk BB'  ,if(GetFieldSelections(WeekShort)<month(Date#(WeekShort,'MMM')) or Month(Date#(POPER_NEW, 'MMM'))<month(today())  ,'Thereof BB', 'Thereof BB'))

Any help on this?

Thank you.

15 Replies
apoorvasd
Creator II
Creator II
Author

Hi Tresesco,

This works only when i make a selection in WeekShort. I would like to apply the same condition when a month is selcted also. Month Field here is POPER_NEW.

Thank you.

tresesco
MVP
MVP

This?

=If(GetSelectedCount(WeekShort) OR  GetSelectedCount(POPER_NEW), If(Max(WeekShort)<MonthStart(Today()), 'Thereof BB','Risk BB'), 'Your Suitable message')

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Or maybe a bit simpeler (assuming that whether you do or don't actively select months or weeks, the chart will display something, and the title should be adjusted accordingly)

=IF (Max(WeekShort) < MonthStart(Today()), 'ThereofBB', 'Risk BB')

apoorvasd
Creator II
Creator II
Author

Works Perfectly!

Thank you

apoorvasd
Creator II
Creator II
Author

Hi Peter,

Even your solution works perfectly!

Thank you very much! Not sure which one to mark as right answer now

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Chose the one that best answered your question. Don't worry, you won't offend me by rewarding one of my own heroes . But please do close the discussion by assigning a Correct Answer.

Since a lot of people provided valuable information, you may consider assigning Helpfuls to the replies that were most... helpful (see the Actions menu underneath each post)