Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

fungcheung
New Contributor

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
Honored Contributor III

Re: Divided into 10% Group by Ranking

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

2 Replies
antoniotiman
Honored Contributor III

Re: Divided into 10% Group by Ranking

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
New Contributor

Re: Divided into 10% Group by Ranking

Dear Antonio,

Thanks for your suggestion, it is workable.

Community Browser