Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I need some help with splitting a table in intervals
I have a simple table that has two fields
customerid, totalamount
This table is changed from day to day.
What I want to do is to add a column to this table ranking customers from 1-5 depending on how much they've bought (totalamount). So i want to split the table into 5 "clusters" ranking from 5-1 where 5 is the customers who has bought the most.
This seems fairly simple but I can't figure it out
Thanks in advance!
For the second part of your question you can change the last part of the script into:
Table:
LOAD Customerid,
RowNo() as Rank,
SumTotalamount
RESIDENT Temp_Table
Where SumTotalamount >'0'
ORDER BY SumTotalamount desc;
I hope you have already resolved your problem. If not, you may review the attached qvw file for a solution.