Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have been trying to do a histogram with a dynamic dimension so that I always get 15 bars on the x-axis ranging from the minimum possible value to the maximum possible value but can't get it to work.
I have a used Recipe for a Histogram but instead of using a input box to give the BinWidth I want to calculate it so that it always will be 15 bars in the diagram.
I have tried to use:
=round(randNum, ((max(randNum)-min(randNum)/15) ,0.1))
and
=round(randNum, ((max({$} randNum)-min({$} randNum)/15) ,0.1))
as calculated dimension but I get "// Error in Calculated dimension" as a error from the plott. If I use the ALL according to:
=round(randNum, ((max(ALL randNum)-min(ALL randNum)/15) ,0.1))
as dimension I get what I what in the case that no selection is made but not otherwise and why doesn't:
=round(randNum, ((max({1} randNum)-min({1} randNum)/15) ,0.1))
Work even though max({1} randNum) evaluates to the same as max(ALL randNum)?
Could this be solved?
I insert the qvw-file I have been trying on.
Regards
Per
Hi,
solutions could be:
Dimension:
=Num(Aggr(Floor(randNum,(max(TOTAL randNum)-min(TOTAL randNum))/15), randNum),'#0,00')
Expression:
=count(randNum)
or
Dimension:
=ValueLoop(min(TOTAL randNum),max(TOTAL randNum),(max(TOTAL randNum)-min(TOTAL randNum))/15)
Expression:
=-Sum(randNum>=ValueLoop(min(TOTAL randNum),max(TOTAL randNum),(max(TOTAL randNum)-min(TOTAL randNum))/15) and randNum<ValueLoop(min(TOTAL randNum),max(TOTAL randNum),(max(TOTAL randNum)-min(TOTAL randNum))/15)+(max(TOTAL randNum)-min(TOTAL randNum))/15)
that even generates bins without occurrences.
hope this helps
regards
Marco
You could use aggregation-functions within a calculated dimension but they must be wrapped in an aggr-function: AGGR...
- Marcus
Hi,
solutions could be:
Dimension:
=Num(Aggr(Floor(randNum,(max(TOTAL randNum)-min(TOTAL randNum))/15), randNum),'#0,00')
Expression:
=count(randNum)
or
Dimension:
=ValueLoop(min(TOTAL randNum),max(TOTAL randNum),(max(TOTAL randNum)-min(TOTAL randNum))/15)
Expression:
=-Sum(randNum>=ValueLoop(min(TOTAL randNum),max(TOTAL randNum),(max(TOTAL randNum)-min(TOTAL randNum))/15) and randNum<ValueLoop(min(TOTAL randNum),max(TOTAL randNum),(max(TOTAL randNum)-min(TOTAL randNum))/15)+(max(TOTAL randNum)-min(TOTAL randNum))/15)
that even generates bins without occurrences.
hope this helps
regards
Marco