Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi all,
i have Some random Value and i need to create Range like -
0 - 0.1
0.2 - 0.3
0.4 - 0.5
0.6 - 0.8
0.8 - 1.0
I made Use of Class Function it gives me Following Output
0-0.1
0.1-0.2
0.2-0.3
i don not want repeated Values
Thanks,
You can use if statement to do it:
If(Value <= 0.1, '0 - 0.1',
If(Value <= 0.3, '0.2 - 0.3',
If(Value <= 0.5, '0.4 - 0.5',
If(Value <= 0.8, '0.6 - 0.8', '0.8 - 1.0'))))
For sorting trouble you can further add a dual function:
If(Value <= 0.1, Dual('0 - 0.1', 1),
If(Value <= 0.3, Dual('0.2 - 0.3', 2),
If(Value <= 0.5, Dual('0.4 - 0.5', 3),
If(Value <= 0.8, Dual('0.6 - 0.8', 4), Dual('0.8 - 1.0', 5)))))
I've been meaning to try using IntervalMatchfor this sort grouping
Am sure it would look nicer than nested IF (no idea if it would function any better!)
I like the CLASS and ROUND function - will make use of those!
I reckon ROUND is the best bet. I played around with:-
setting an Interval variable:
LET vInterval = 0.1;
Then adding the ROUND function into the load script (i used [iNum] as my number field)
ROUND(iNum-($(vInterval)/2),$(vInterval)) & ' to ' & (ROUND(iNum-($(vInterval)/2),$(vInterval))+($(vInterval)-($(vInterval)/10))) AS [iRound]
that creates groups as:
0.1 to 0.19
0.2 to 0.29
0.3 to 0.39 etc