Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Swathi
Creator
Creator

Color coding in scatter plot

i have created scatter plot to show qty and cm of current and previous year for all customers

bubble - if(tkt_Year= $(vYear),customer& ' '& $(vYear), if(tkt_Year= $(vpreYear),customer & ' '& $(vpreYear)))

X axis- Sum({<Period,[MonthYear]={ ">=$(=(vMinYearMonth) )<=$(=(vMaxYearMonth) )" }>+ <Period,[MonthYear]={ ">=$(=(vLimitPrevious_Min) )<=$(=(vLimitPrevious_Max) )" }>} [cm])

Y Axis- Sum({<Period,[MonthYear]={ ">=$(=(vMinYearMonth) )<=$(=(vMaxYearMonth) )" }>+ <Period,[MonthYear]={ ">=$(=(vLimitPrevious_Min) )<=$(=(vLimitPrevious_Max) )" }>} qty)

and colur coding for bubble is

if(tkt_Year = $(vYear), Green(), // Green for the current year if(tkt_Year = $(vpreYear), RGB(0, 191, 255) // Blue for the previous year ) )

 

Swathi_0-1704453523440.png

Now i need give red colur for the current year customers who has less cm compare with last year, less volume compare with last year.

i took year over year growth percentage and whose growth is more than <-10 it should be in red colur or same green colur of current year

i tried below formula,

if(tkt_Year = $(vYear),
if((((Sum({<Period,[MonthYear]={ ">=$(=(vMinYearMonth) )<=$(=(vMaxYearMonth) )" }> }[cm2])-Sum({<Period,[MonthYear]={ ">=$(=(vLimitPrevious_Min) )<=$(=(vLimitPrevious_Max) )" }>} [cm2]))/Sum({<Period,[MonthYear]={ ">=$(=(vLimitPrevious_Min) )<=$(=(vLimitPrevious_Max) )" }>} [cm2]))*100
<(-10)) or (((Sum({<Period,[MonthYear]={ ">=$(=(vMinYearMonth) )<=$(=(vMaxYearMonth) )" }> }delv_qty)-Sum({<Period,[MonthYear]={ ">=$(=(vLimitPrevious_Min) )<=$(=(vLimitPrevious_Max) )" }>} delv_qty))/Sum({<Period,[MonthYear]={ ">=$(=(vLimitPrevious_Min) )<=$(=(vLimitPrevious_Max) )" }>} delv_qty))*100
<(-10)),
Red(), // Red if cm2 for the current year is less than the previous year
Green() // Green for the current year
),
if(tkt_Year = $(vpreYear),
RGB(0, 191, 255), // Blue for the previous year
// Add any other conditions or default color here
)
)

 

it is not showing any customers with red colur,  even they are <(-10). when i tried same thing in table it worked fine, but onlycustomer name and not end with year name. i am thinking the problem with customers name, so it is not giving. to get two bubbles for same customer current year and previous, i have done customer ending year name, so it will give two customers. now i need to colur coding whose customer growth is more than <-10 it should be in red colur or same green colur of current year, previous all should be in blue only, only current year bubbles should change. 

sharing sample which i have tried i n tabel also

Swathi_1-1704454195876.png

if we take example

Swathi_3-1704454324171.png

 

the above screenshot customer has 37%  less cm compare with last year so that value is in negative, so i need that give colour for that customer who has more than 10 %(mean -10%)  growth of cm and qty that customers should be in red colur in scatter plot bubbles for current year.

Kindly help me

 

 

 

Labels (2)
1 Reply
F_B
Specialist II
Specialist II

Hi @Swathi ,

check if there are null values in your data that could cause unwanted behavior. You might need to wrap the conditions with a coalesce or ifnull function to handle potential nulls.