
Re: How to scale all expressions into 1 to 10 scale on Y  axis
Camile Johnson Oct 2, 2015 10:32 AM (in response to Bhushan Nirgude)Hi Bhushan,
Is this requirement dynamic or is it static? For example  as the user makes selections the minimum and maximum value will change  will it be rescaled (from 1 to 10) based on selections or is the minimum and maximum value based on what is originally defined in the script (with all selections cleared).
Thanks,
Camile

Re: How to scale all expressions into 1 to 10 scale on Y  axis
Clever Anjos Oct 2, 2015 10:37 AM (in response to Bhushan Nirgude)Maybe expressions like this can do what you need
SUM(Sales) / Sum(TOTAL Sales) // This return a number between 0 and 1
ceil(10* SUM(Sales) / Sum(TOTAL Sales)) // This return a number between 1 and 10

Re: How to scale all expressions into 1 to 10 scale on Y  axis
Bhushan Nirgude Oct 2, 2015 11:16 AM (in response to Clever Anjos )Hi Clever Anjos ,
Cheers !! .. its very close to finish .
" ceil(10* SUM(Sales) / Sum(TOTAL Sales)) " looks working fine , but there is one problem in that .
I hv data of 3 years while monthly chart which i mentioned is for last 15 months only , so how sum( tOTAL sales) can be modified to dimension range defined ( here its 15 months) ??
ALso, how I can take this to for avg bill value which is sum(Sale) / sum ( bills) for particular month

Re: How to scale all expressions into 1 to 10 scale on Y  axis
Camile Johnson Oct 2, 2015 11:40 AM (in response to Bhushan Nirgude)Is it based on the min/max value for the month or the min/max value over the entire period? See attached (and explanation below) for min of the month (over entire time frame selected). All you would have to do in that case is change the variable value to incorporate Month as part of the aggr function. To make the min/max value be within each month/dynamic you would need something a little different.

Re: How to scale all expressions into 1 to 10 scale on Y  axis
Camile Johnson Oct 2, 2015 12:01 PM (in response to Bhushan Nirgude)Hi Bhushan,
I've made some final modifications to the concept I've been describing (attached).
There is a chart that calculates the min/max value over the entire timeframe selected.
And there is another chart that calculates the min/max value for each month to determine the scale.
Let me know if this helps.
Thanks,
Camile



Re: How to scale all expressions into 1 to 10 scale on Y  axis
Srikanth P Oct 2, 2015 10:50 AM (in response to Bhushan Nirgude)I believe you need to use the Fixed scale for all expressions if you use stack Bar graph

Re: How to scale all expressions into 1 to 10 scale on Y  axis
Camile Johnson Oct 2, 2015 11:21 AM (in response to Bhushan Nirgude)Hi Bhushan,
I've incorporated a few of the ideas mentioned above in an example. The first column highlighted below indicates the use of the ceiling function mentioned above.
I have also used a function below (second column highlighted) with the following function model:
f(x) = (b  a)(x  min) + a
max  min
In your example a = 1 and b = 10, but it could be substituted with any scale. I have listed the minimum sum by the dimension (which is stored in a variable called vMinValue). There is also a vMaxValue by the same dimension (in this case called Member). I'm not sure if this is your intent.
Please see attached for more details.
Thanks,
Camile

Re: How to scale all expressions into 1 to 10 scale on Y  axis
Camile Johnson Oct 2, 2015 11:28 AM (in response to Camile Johnson )The above example uses the following concept:
and uses cleveranjos idea mentioned below:
Maybe expressions like this can do what you need
SUM(Sales) / Sum(TOTAL Sales) // This return a number between 0 and 1
ceil(10* SUM(Sales) / Sum(TOTAL Sales)) // This return a number between 1 and 10
For the function you would need to modify your min and max variables accordingly.

Re: How to scale all expressions into 1 to 10 scale on Y  axis
Bhushan Nirgude Oct 2, 2015 1:49 PM (in response to Camile Johnson )Hi Camile ,
I am just working on the suggestion provided by you .
For me there is no Customers , as all my calculations are no monthly . So i m just remving customers from your equation.
My final outcome is line chart of all my expressions within 1 to 10 for last 15 months ....
I m still struggling in getting functional value by teh logic u given * i.e. max & min ).. so debugging the same .

Re: How to scale all expressions into 1 to 10 scale on Y  axis
Camile Johnson Oct 2, 2015 2:00 PM (in response to Bhushan Nirgude)So from the example above you should just be able to switch Member with Month for the variable values....
Just use the first attachment I put together (only by Member) and switch the variable from Member to Month (and switch the dimension from Member to Month as well).

Re: How to scale all expressions into 1 to 10 scale on Y  axis
Bhushan Nirgude Oct 2, 2015 5:05 PM (in response to Camile Johnson )Thanks a zillion Camile J ,
It works for me .... !!!!!
really appreciating power of Community ..


Re: How to scale all expressions into 1 to 10 scale on Y  axis
Camile Johnson Oct 2, 2015 2:47 PM (in response to Bhushan Nirgude)Hi Bhushan,
I'm glad it was able to work.
I'm not sure if you can change it or not  but can you instead mark the answer with the attachment as correct as I think it will be more useful for people trying to find/use a working example.
Thanks,
Camile

