Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
fungcheung
Partner - Contributor II
Partner - Contributor II

Divided into 10% Group by Ranking

I have two column of data, which are "Customer ID" and "Transaction Amount".

Capture.PNG

And we decide to divided those customer into 10% group (it should be 2 customers each group for this sample data) by ranking their transaction amount.

Should we have any methods to divided those customer into the follow result:

Capture2.PNG         Capture3.PNG

1 Solution

Accepted Solutions
antoniotiman
Master III
Master III

Hi,

maybe this

Table:
LOAD * Inline [
Customer,Amount
1,1500
2,1400
3,1300
4,1200
5,1100
6,100
7,900
8,800
9,700
10,600
11,500
12,400
13,300
14,200
15,100
16,100
17,100
18,100
19,100
20,100
21,100
]
;
Let vNr=Floor(NoOfRows('Table')*0.1);
Left Join
LOAD Customer,Autonumber(Floor(Rowno()-1,$(vNr))) as Group
Resident
Table;

Regards,

Antonio

View solution in original post

2 Replies
antoniotiman
Master III
Master III

Hi,

maybe this

Table:
LOAD * Inline [
Customer,Amount
1,1500
2,1400
3,1300
4,1200
5,1100
6,100
7,900
8,800
9,700
10,600
11,500
12,400
13,300
14,200
15,100
16,100
17,100
18,100
19,100
20,100
21,100
]
;
Let vNr=Floor(NoOfRows('Table')*0.1);
Left Join
LOAD Customer,Autonumber(Floor(Rowno()-1,$(vNr))) as Group
Resident
Table;

Regards,

Antonio

fungcheung
Partner - Contributor II
Partner - Contributor II
Author

Dear Antonio,

Thanks for your suggestion, it is workable.