Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear All,
I am facing a problem during projection of different colors in Line Chart using Color by expression feature.
I have a YEARMONTH field from my loading script which is having values in YYYYMM format e.g. 202101,202102 etc.
Within the line trend I have used expression num#(Date(Date#(YEARMONTH,'YYYYMM'),'YYYY')) to convert it into X-Axis (year) as line trend and it is working fine, but when I am using this same expression within IF statement to project multiple colors e.g. red for 2019,green for 2020 it is not working.
The color by expression is mentioned below :
IF(num#(Date(Date#(YEARMONTH,'YYYYMM'),'YYYY')) = 2019,red(),
IF(num#(Date(Date#(YEARMONTH,'YYYYMM'),'YYYY')) = 2020,green(),
IF(num#(Date(Date#(YEARMONTH,'YYYYMM'),'YYYY')) = 2021,blue(),
IF(num#(Date(Date#(YEARMONTH,'YYYYMM'),'YYYY')) = 2022,yellow()
))))
I am using Color by expression with 'The expression is a color code' is checked.
Kindly suggest if there is a change needed in the expression above to project different colors for yearwise trend lines.
Thanks in advance
Arghya
Would it be possible to have a sample app with what you have so far for this visualisation?