Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Median value on x-axis

I have a bar chart (histogram, really) where the x-axis is a rounded number of hours (the delay in hours between admission to hospital and the start of surgery), and the y-axis is the number of cases.

Is there a way to show a vertical line at the median number of hours?

RoundedOpDelay is a dimension, calculated on data load.  However, I also have a separate numeric field called Delay(Hrs) to two decimal places if that works better.

Thanks,

Steve

12 Replies
Anonymous
Not applicable
Author

Thanks, Rob,

You'll have seen the peculiarities in June 2017's Colors / Custom / by Expression.  My original application had a map with the location of ambulance pick-up points by the type of injury event, where a car crash displayed a blue spot, motorcycle was cyan, fall was red, and so on for six trauma types.  It made a very interesting and informative map.  (This is a tiny illustration.)

All of the spots became grey with June 2017's release.

I found a post that explained that colours had to be enclosed in speech marks ('), and I've alternated these depending on the effect.

In case other people have this problem, your color(2) works without speech marks. Red() - a rich, deep colour - works without, but red (a dramatic crimson) needs them: 'red'.

In my map, both RGB and ARGB must be enclosed

but in a plain bar chart they don't:

I understand that this is a bug that will be fixed in an update, but in the meantime a little experimentation helps!

Steve

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

The map bug I'm not sure about. But I can explain the quote requirement on the bar chart.

RBG() and red() are both functions (note the parens) that must be evaluated, so they are unquoted.

'red' is a "color keyword" and it therefore quoted as literal string.

Interesting how many flavors or red we have now

-Rob

linhnguyen
Contributor II
Contributor II

Hello,

Your example is very useful, I tried to follow your instruction, but not sure where you put the formula. Was it at "Add-ons" or elsewhere? Thank you