-
Re: how to bucketize field values for a measure
Petter Skjolden Jan 19, 2018 6:07 PM (in response to Casey Marincin)The function Class() should do it for you - like this:
Class(Days,10,'Days',1)
Actually this will have binsize of 10 and your list has the first one with binsize of 11 and the rest 10... so it won't really work exactly as you want. But then again 0 days is not present in your data so why 0-10 ?
-
Re: how to bucketize field values for a measure
Casey Marincin Jan 19, 2018 6:22 PM (in response to Petter Skjolden )The data I presented is a very contrived simplification of my actual data. (I am unable to post my actual data for proprietary reasons.) My actual bin intervals and desired output are:
0 - 90 <1/4 Year
91 - 180 1/4 - 1/2 Year
181 - 270 1/2 - 3/4 Year
271 - 365 3/4 - 1 Year
>365 >1 Year
My actual Day values span 0 to 365+. I presented a simplification as I thought that any solution proposed would be independent of the actual distribution of data and desired dimension values. So, I don't think Class() will work for me.
-
-
Re: how to bucketize field values for a measure
Petter Skjolden Jan 19, 2018 6:44 PM (in response to Casey Marincin)If you need it exactly like your bucket categories then you could use this expression to create a new field in your load statement in the load script:
If(Days>=0 AND Days<=10,Dual('0-10',0),Dual((Div(Days,10)*10+1)&'-'&(Div(Days,10)+1)*10,Div(Days,10)))