Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey guys,
I'm currently building an application and I'm in need of a chart giving me an overview of the median and the standard deviation.
I have a field named duration. So basically I need the Standard deviation and median of this field as the dimension of my barchart. And as the expression I need a count of my OrderID's.
However if I build my chart in qlikview, it says error in calculated dimension.
How can this be solved.
ALL help is welcome 🙂
Dimension = STDEV(Duration)
Expression = Count(OrderID)
create a calculated Dimension at chart level or create the same dimension in the EditScript Part if Possible.
Rgds,
Ajay
Dear Ajay,
Thanks for you help, I'm working with a calculated dimension at chart level.
Hardcode my Median and Standard Deviation at script level is not intresting for my solution. Because the purpose of my chart is for it to be dynamic.
Still help is welcome 🙂
Regards
Sajjad,
BUMP!
This is what I'm looking to achieve in my chart.
I Need 1 dimension going from (M - 3SD to M +3SD)
M = Median
SD = Standard Deviation
I Need 1 expression counting the OrderID's
The class function doesn't seem to help much.
Enclosed you will find an image of the chart I made in paint
Well, I thought this would work (though not generate the legends you want):
Dimension = class(Duration,stdev(Duration),'Duration',avg(Duration))
But it doesn't. If I replace the two functions with the values they return, it DOES work. Oh, that's right. I can't do aggregation functions in a dimension without using aggr(). Well, actually, in this case, we can do it with a dollar sign expansion. So this:
Dimension = class(Duration,$(=stdev(Duration)),'Duration',$(=avg(Duration)))
And that gives us the right intervals for our dimension, but labels them in an ugly way. So we probably just have to beat it with a hammer instead of being clever:
Dimension =if(Duration<$(=avg(Duration))-3*$(=stdev(Duration)),dual('EXTR',1)
,if(Duration<$(=avg(Duration))-2*$(=stdev(Duration)),dual('M-3SD',2)
,if(Duration<$(=avg(Duration))-1*$(=stdev(Duration)),dual('M-2SD',3)
,if(Duration<$(=avg(Duration))-0*$(=stdev(Duration)),dual('M-1SD',4)
,if(Duration<$(=avg(Duration))+1*$(=stdev(Duration)),dual('M+1SD',5)
,if(Duration<$(=avg(Duration))+2*$(=stdev(Duration)),dual('M+2SD',6)
,if(Duration<$(=avg(Duration))+3*$(=stdev(Duration)),dual('M+3SD',7)
,dual('EXTR',8))))))))
See attached.