Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I am trying to create value buckets on an existing field. My field is 'VendorSpend' and I want the buckets like:
>50k
50k-250k
250k-500k
500k-1m
and so on.
Any help is much appreciated. Thanks
I
In Script:
Load *,
If((VendorSpend) < 50000, Dual('<50k', 1),
If((VendorSpend) < 250000, Dual('50k-250k', 2),
If((VendorSpend) < 500000, Dual('250k-500k', 3),
If((VendorSpend) < 1000000, Dual('500k-1m', 4))))) as VendorBracket
From XYZ
I am guessing that this would be a calculated dimension? May be like this:
Aggr(
If(Sum(VendorSpend) < 50000, Dual('<50k', 1),
If(Sum(VendorSpend) < 250000, Dual('50k-250k', 2),
If(Sum(VendorSpend) < 500000, Dual('250k-500k', 3),
If(Sum(VendorSpend) < 1000000, Dual('500k-1m', 4)))))
, Vendor)
In Script:
Load *,
If((VendorSpend) < 50000, Dual('<50k', 1),
If((VendorSpend) < 250000, Dual('50k-250k', 2),
If((VendorSpend) < 500000, Dual('250k-500k', 3),
If((VendorSpend) < 1000000, Dual('500k-1m', 4))))) as VendorBracket
From XYZ
Thanks Rupam. Exactly what i wanted.
Thanks but i don't need summation.