Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello all.
I have a line chart which tracks the average weight of patients following surgery.
Dimensions:
Year
Procedure Type
Expression:
Average Weight
The chart works well, however the number of patients attending a check-up 10 years after surgery is significantly lower than those attending 1 or 2 years after surgery – and the average weight of 2 patients isn’t really useful to anyone…
I was wondering if it’s possible to include the volume of patients on each data point?
Checking Values On Data Points obviously displays the average weight rather than the number of patients.
Thanks in advance, Michael.
Use as expression something like dual(count(Patients), avg(Weight)). Replace Patients and Weight with the correct field names of your data model.
Use as expression something like dual(count(Patients), avg(Weight)). Replace Patients and Weight with the correct field names of your data model.
Thanks gwassenaar – this is useful and is very nearly perfect, however…
I have a variable toggle button to hide/show the values on the data points (as it can become very crowded) in which case the second part of the dual statement is displayed, so it’s showing the value for avg(weight) rather than count(patient).
If I switch avg(weight) and count(patient) around in the dual expression then the values on data points works, but the y axis switches to count(patient) rather than avg(weight) which is not good.
Hope than makes sense and thanks again.
=dual(count(PATIENT),avg(WEIGHT))
By the way – if I check Values on Data Points for the above expression it displays the count(PATIENT) value, although I can’t control whether or not it’s displayed.
If I uncheck Values on Data Points and use a variable in the Show Value sub-expression then it displays the avg(WEIGHT) value which is not what I want – but I can control whether or not it is displayed.
Not really. I don't understand how you show/hide the values on the datapoints. Are you using the Text Color setting of the expression? Something like if(vShow, color(1), red(0)). With that nothing gets displayed if vShow is false since red(0) means 100% transparant red.
I have a button labelled ‘show/hide’ which toggles the variable vShowValues between 0 and 1.
In the Show Value sub-expression I have =vShowValues
Ah, right. I see the issue now. Well, try keeping Values on Data Points enabled and use the Text Color setting instead.
That works – thanks for your help Gysbert, I really appreciate it.