Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi folks,
Obviously new to QlikSense and to coding generally. I'm trying to normalize the results of a value set on a 0-100 scale. Here's the expression:
=(((count(distinct [Incident Number]))+Sum([Drug Weight (lb)]))/Sum([Total]))
Results range from .00001 to 50.
Any way to set the value range to Rangemax = 100 and Rangemin = 0 ?
How do you do that within the expression?
I'm assuming you are calculating this over a Dimension, for example "Drug". If so, then you need to compute the max Drug value and use that as a divisor. Use max() and aggr() to find the largest value.
=(((count(distinct [Incident Number]))+Sum([Drug Weight (lb)]))/Sum([Total]))
/ Max( Aggr( (((count(distinct [Incident Number]))+Sum([Drug Weight (lb)]))/Sum([Total])), Drug))
And then multiply the whole thing by 100 unless you want it as a percent.
-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com
I'm assuming you are calculating this over a Dimension, for example "Drug". If so, then you need to compute the max Drug value and use that as a divisor. Use max() and aggr() to find the largest value.
=(((count(distinct [Incident Number]))+Sum([Drug Weight (lb)]))/Sum([Total]))
/ Max( Aggr( (((count(distinct [Incident Number]))+Sum([Drug Weight (lb)]))/Sum([Total])), Drug))
And then multiply the whole thing by 100 unless you want it as a percent.
-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com
You're the man.