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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Bar Color Based on Calculated Dimension

Hi,

I have a bar chart with 1 dimension that is a calculated dimension. Specifically,

=Num(floor(Sales,vStdev,vMedian),'$#,##0.00'),

Where Sales is a regular dimension corresponding to a numerical value, vStdev is the standard deviation of Sales, and vMedian is the median of Sales.

My bar chart's expression then counts the number of Sales within each bucket (calculated dimension), i.e.,

count(Sales)

I want to have only the bar corresponding to the median value be green. I am attempting to accomplish this via the 'Background Color' option of my expression with to following expression,

=if(Num(floor(Sales,vStdev,vMedian),'#,##0.00')=Num(vMedian,'#,##0.00'),Green()),

but to no avail.

Any help will be appreciated. I have attached a sample qvw illustrating my problem and desired outcome.

Thanks and best regards,

Ryan

1 Solution

Accepted Solutions
Not applicable
Author

I figured it out. The solution is to use the expression

=if(Num(floor(Avg(Sales),vStdev,vMedian),'#,##0.00')=Num(vMedian,'#,##0.00'),Green())

for 'Background Color'.

View solution in original post

1 Reply
Not applicable
Author

I figured it out. The solution is to use the expression

=if(Num(floor(Avg(Sales),vStdev,vMedian),'#,##0.00')=Num(vMedian,'#,##0.00'),Green())

for 'Background Color'.