Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

swamydsp
New Contributor

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

Re: Qlik Sense, custom colors by dimension

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

MVP
MVP

Re: Qlik Sense, custom colors by dimension

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.