Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have a list of product IDs and I want to group them in buckets by spend in descending order. For example, if I have 100 product IDs, I want to group them in 4 buckets ([1-25], [26-50], [51-75], [76-100]) form highest to lowest overall spend. I assume once I have them set as a dimension, I'll be able to run other analysis on the same buckets.
Thanks,
Paul
then an inlin load should help.
load * inline[
ID, group
1, [1-25]
2, [1-25]
...
25, [1-25]
26, [26-50]
....
]
;
HI
Try like this
Load *,
If(ProductID <= 25, '[1-25]', If(ProductID <= 50, '[26-50]', If(ProductID <= 75, '[51-75]', '[76-100]'))) AS Bucket
from tablename; //datasource
hope it helps
My only problem is that I don't want to place them in buckets based on the ProductID, I want to put them in buckets based on spend BY ProductID. Highest 25 spend ProductIDs first, then second 25, etc.
Thanks,
Paul