Hi I have a dataset and I have to create a group based on the same quantity. Below is the sample
Id | Quantity | Price |
45123EX | 1000 | 100 |
45123EX | 1000 | 200 |
45123EX | 300 | |
45123EX | 2000 | 150 |
45123EX | 2000 | 250 |
45123EX | 400 | |
42748929 | 50 | 450 |
42748929 | 50 | 100 |
42748929 | 550 |
Condition: I have to create a group based on a similar Id and quantity. For example 451123EX and 1000 (quantity) makes a group so I have to assign a unique value to it.
Output:
d | Quantity | Price | Recod Id |
45123EX | 1000 | 100 | 1 |
45123EX | 1000 | 200 | 1 |
45123EX | 300 | 1 | |
45123EX | 2000 | 150 | 2 |
45123EX | 2000 | 250 | 2 |
45123EX | 400 | 2 | |
42748929 | 50 | 450 | 3 |
42748929 | 50 | 100 | 3 |
42748929 | 550 | 3 |
@Sshasnk
Something like this should help.
User | Count |
---|---|
106 | |
85 | |
76 | |
54 | |
40 |