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

Qlik Sense, custom colors by dimension

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')

9.PNG

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

2 Replies
Anil_Babu_Samineni

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())

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
petter
Partner - Champion III
Partner - Champion III

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.