Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm loading dimension from the database, dimension is a date value. I'm using following formula to change to 'MMM-YY', also shwon in the below image. =Date(monthstart(D_CREATE_DATE), 'MMM-YY')
I'm having trouble to change the bar color for Mar-17.
I'm using color by expression and using following formula, but I'm not able to change to color to green for dimension value of 'Mar-17'
=If(Date(monthstart(D_CREATE_DATE), 'MMM-YY') = 'Mar-17', Green(), Red())
Any help is appreciated.
Thanks
Try like below?
=If(FieldName = 'Mar-17', Green(), Red()) // Try this first
Or
=If(Month(D_CREATE_DATE, 'MMM' & '-' & Year(D_CREATE_DATE,'YY')) = 'Mar-17', Green(), Red())
You will have to use an aggreation function with your date to get it to work:
=If(Date(Min((D_CREATE_DATE),'MMM-YY')='Mar-17',Green(),Blue())
If can't compare multiple dates with 'Mar-17' so you will have to pick one of them even if they are in the same month.