Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
david_pearson
Contributor III
Contributor III

Change colour of bar in a bar chart depending on previous bar values

Hi all, i have 2 bar charts. i want to colour each bar depending on the previous bar vol/value. For example. if bar 2 (2M OD) is greater than the value/vol  of "1M OD" then i want it to be coloured red. If lower than the previous bar then green. Note that the dimension may not always be there as per image 2. The dimension im using is called "AGEING" and my expression is below...as you can see variable buttons are being used too. Presumably this needs to be a colour by expression??

if($(vButtons)=1,
num(count(distinct{<COLL_STATUS={'Overdue'},[REPORT_DATE.autoCalendar.YearMonth] = {"$(=Date(AddMonths(Max(TOTAL [REPORT_DATE.autoCalendar.YearMonth] ), 0), 'YYYY-MMM'))"}>}COLL_POL_NO),'#,##0', '.',','),
if($(vButtons)=2,
num(count({<COLL_STATUS={'Overdue'},[REPORT_DATE.autoCalendar.YearMonth] = {"$(=Date(AddMonths(Max(TOTAL [REPORT_DATE.autoCalendar.YearMonth] ), 0), 'YYYY-MMM'))"}>}COLL_AGENCY_REF),'#,##0', '.',','),
if($(vButtons)=3,
NUM( sum({<COLL_STATUS={'Overdue'},[REPORT_DATE.autoCalendar.YearMonth] = {"$(=Date(AddMonths(Max(TOTAL [REPORT_DATE.autoCalendar.YearMonth] ), 0), 'YYYY-MMM'))"}>}GBP_NET),'£ #,##0', '.',','))))


david_pearson_1-1600683044071.jpeg

david_pearson_2-1600683120927.jpeg

 

 

0 Replies