Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
tomdabek
Contributor III
Contributor III

Help with Background color property

I have a line chart to show market share by year using 2 dimensions - year and Supplier

My expression to show the lines seems unnecessarily complicated for what you would think is a simple task and I wonder if it is creating the problem with my Background Color preventing it from working properly.

 

The calculation expression:

Sum({<Year={">=$(=AddYears(Max(Year),-1)) <=2020"}>} Volume)
/
Sum({<Year={">=$(=AddYears(Max(Year),-1)) <=2020"}>} total <Year> Volume)

 

The expression i use for background color is:

if(SupplierParentID=1, RGB(34,134,39),
if(SupplierParentID=730, RGB(230,25,75),
if(SupplierParentID=59, RGB(255,225,25),
if(SupplierParentID=607, RGB(0,130,200),
if(SupplierParentID=826, RGB(245,130,48),
if(SupplierParentID=859, RGB(170,110,40),
if(SupplierParentID=897, RGB(240,50,230),
if(SupplierParentID=320, RGB(128,0,0),
if(SupplierParentID=322, RGB(70,240,240),
RGB(128,128,128),
)))))))))

 

If the field Year has nothing selected, the color of each line and the legend appears correctly

 

BUT, if a given year is selected, say 2019 then the portion of the line in the chart between 2019 and 2020 is correctly displayed with the appropriate color.  If the user selects all the years, all the lines appear as intended

 

The legend however, ONLY displays the correct color if no year or all years are selected.

 

Thanks

 

0 Replies