Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello
My data look like this: (see table below). There are 4 stores, each selling different fruits. The "Buy" field indicates whether to buy that fruit from that store or not. I made a straight table to display how many items to buy/not buy from each store. I would like to color the straight table this way: Comparing it with my favorite fruit list:(Apple, Orange, Strawberry, Banana). For each store, if the one of my favorite fruit is brought there, color the cell Green, if not brought, color the cell Purple (see sample below)
Can someone help with the coloring?
Thanks
Yvonne
Store | Item | Buy |
A | Apple | Y |
A | Pear | Y |
A | Watermelon | N |
B | Apple | N |
B | Pineapple | N |
B | Orange | Y |
B | Tomato | N |
C | Pear | Y |
C | Watermelon | N |
C | Apple | N |
C | Strawberry | N |
D | Banana | N |
D | Blueberry | Y |
D | Pear | N |
chart
expression
count({<Buy={Y}>} DISTINCT Item)
yes, background color
if(count({<Buy={Y}, Item={Apple,Orange,Strawberry,Banana}>} DISTINCT Item)>0, Green())
script
fruits:
load * inline [
Store Item Buy
A Apple Y
A Pear Y
A Watermelon N
B Apple N
B Pineapple N
B Orange Y
B Tomato N
C Pear Y
C Watermelon N
C Apple N
C Strawberry N
D Banana N
D Blueberry Y
D Pear N
] (delimiter is spaces);
PFA
HI Maxgro,
I'm still in the process of getting a QV license, so I can't open your QV file. I assume you added an expression to the background color ? Can you share the expression?
Thanks
Yvonne
chart
expression
count({<Buy={Y}>} DISTINCT Item)
yes, background color
if(count({<Buy={Y}, Item={Apple,Orange,Strawberry,Banana}>} DISTINCT Item)>0, Green())
script
fruits:
load * inline [
Store Item Buy
A Apple Y
A Pear Y
A Watermelon N
B Apple N
B Pineapple N
B Orange Y
B Tomato N
C Pear Y
C Watermelon N
C Apple N
C Strawberry N
D Banana N
D Blueberry Y
D Pear N
] (delimiter is spaces);