Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Is it possible to distribute a given value like 50.000, across a range of yearmonths (sorted in ascending order), following a bell curve distribution, directly in the frontend in a table?
example
load * Inline
[
year_Calendarmonth
202401
202402
202403
202404
202405
202406
]
;
vTestinput = 50000;
Yes and no. There is a whole part of math behind a bell curve. Currently we are using the values in the year_CalendarMonth field. This is used in the math, Hence the reason when you added the other value this does not represent a bell curve anymore.
Distribution of 1 I would just normalize the data using the variable = 1 and not 50000. I am looking into this to add "random" values and getting a perfect result.
Mark the solution as accepted that solved your problem and if you found it useful, press the like button! Check out my YouTube Channel | Follow me on LinkedIn
Hi @Noctis
We need to assign a value (In terms of the number size) to the value. This will ensure that the value always changes on selection and is not influenced by something like 200001 vs 208811. Below is my inline load
Expression
Only(NormDist(Aggr(Rank(year_CalendarmonthID), year_CalendarmonthID), Avg(Total Aggr(Rank(year_CalendarmonthID), year_CalendarmonthID)),
Stdev(Total Aggr(Rank(year_CalendarmonthID), year_CalendarmonthID)), 0))
* 0.1
* Count(Total year_CalendarmonthID)
* (50000 / Sum(Total Aggr(Only(NormDist(Aggr(Rank(year_CalendarmonthID), year_CalendarmonthID), Avg(Total Aggr(Rank(year_CalendarmonthID), year_CalendarmonthID)),
Stdev(Total Aggr(Rank(year_CalendarmonthID), year_CalendarmonthID)), 0)) * 0.1 *
Count(Total year_CalendarmonthID), year_CalendarmonthID)))
My result
Regards - Jandre
Mark the solution as accepted that solved your problem and if you found it useful, press the like button! Check out my YouTube Channel | Follow me on LinkedIn
Hi @Noctis
You can Create a Line Chart with Dimension "year_Calendarmonth"
Expression would be this.
Only(NormDist(year_Calendarmonth, Avg(Total year_Calendarmonth), Stdev(Total year_Calendarmonth), 0)) * 0.1 * Count(Total year_Calendarmonth)
And then using the input variable would be this
Only(NormDist(year_Calendarmonth, Avg(Total year_Calendarmonth), Stdev(Total year_Calendarmonth), 0)) * 0.1 * $(vTestinput)
Mark the solution as accepted that solved your problem and if you found it useful, press the like button! Check out my YouTube Channel | Follow me on LinkedIn
Thanks Jandre, but I need this as a Table. do you have a solution for that too?
Hi @Noctis
Not at my pc now, but have you tried building the LineChart? Maybe just try and convert to table?
Let me know.
Mark the solution as accepted that solved your problem and if you found it useful, press the like button! Check out my YouTube Channel | Follow me on LinkedIn
it goes in the right direction but it does not fully distribute the whole 50000
Hi @Noctis
Just change the 50000 to the variable that you are using.
Only(NormDist(year_Calendarmonth, Avg(Total year_Calendarmonth), Stdev(Total year_Calendarmonth), 0)) * 0.1 * Count(Total year_Calendarmonth)
* (50000 / Sum(Total Aggr(Only(NormDist(year_Calendarmonth, Avg(Total year_Calendarmonth), Stdev(Total year_Calendarmonth), 0)) * 0.1 * Count(Total year_Calendarmonth), year_Calendarmonth)))
Mark the solution as accepted that solved your problem and if you found it useful, press the like button! Check out my YouTube Channel | Follow me on LinkedIn
I added 202352 and Now its not a Bellcurve anymore. Do you have another solution?
Additionally I am looking for a total distribution of 1. Only in this case would it represent a perfect bell curve, correct?
Yes and no. There is a whole part of math behind a bell curve. Currently we are using the values in the year_CalendarMonth field. This is used in the math, Hence the reason when you added the other value this does not represent a bell curve anymore.
Distribution of 1 I would just normalize the data using the variable = 1 and not 50000. I am looking into this to add "random" values and getting a perfect result.
Mark the solution as accepted that solved your problem and if you found it useful, press the like button! Check out my YouTube Channel | Follow me on LinkedIn
Hi @Noctis
We need to assign a value (In terms of the number size) to the value. This will ensure that the value always changes on selection and is not influenced by something like 200001 vs 208811. Below is my inline load
Expression
Only(NormDist(Aggr(Rank(year_CalendarmonthID), year_CalendarmonthID), Avg(Total Aggr(Rank(year_CalendarmonthID), year_CalendarmonthID)),
Stdev(Total Aggr(Rank(year_CalendarmonthID), year_CalendarmonthID)), 0))
* 0.1
* Count(Total year_CalendarmonthID)
* (50000 / Sum(Total Aggr(Only(NormDist(Aggr(Rank(year_CalendarmonthID), year_CalendarmonthID), Avg(Total Aggr(Rank(year_CalendarmonthID), year_CalendarmonthID)),
Stdev(Total Aggr(Rank(year_CalendarmonthID), year_CalendarmonthID)), 0)) * 0.1 *
Count(Total year_CalendarmonthID), year_CalendarmonthID)))
My result
Regards - Jandre
Mark the solution as accepted that solved your problem and if you found it useful, press the like button! Check out my YouTube Channel | Follow me on LinkedIn