Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all
I have a table like this
Item Code | Price | Qty. | Total Amount |
---|---|---|---|
A1 | 100 | 1 | 100 |
B12 | 40 | 3 | 120 |
C35 | 70 | 2 | 140 |
D63 | 125 | 1 | 125 |
E23 | 110 | 4 | 440 |
F12 | 200 | 2 | 400 |
G36 | 120 | 1 | 120 |
H66 | 75 | 3 | 225 |
I84 | 50 | 1 | 50 |
J17 | 100 | 1 | 100 |
TOTAL | 1820 |
Now, I want codes for Total Amount of specific Price Range. Like this:
Price Range | Total Amount |
---|---|
X < 50 | 120 |
50 <= X < 75 | 190 |
75 <= X < 100 | 225 |
100 <= X < 125 | 760 |
125 <= X < 150 | 125 |
150 <= X | 400 |
TOTAL | 1820 |
Thank you in advance.
Regards,
Ashkan
You can use Class() function.
E.g.
LOAD *, Class(Price,25,'X',25) as [Price Range];
A solution using this is attached.
add calculated dimension in the dimension tab . in that use this one
=class(aggr(sum(total amount),price),50,'')
for equal interval u can use class function
for un equal interval u have to write the condition in script
PriceRange:
LOAD UnitCost ,
if(total amount>=0 and total amount <=150,Dual('0-50',0-50),
if(
total amount
>50 and total amount <=75,dual('50-75',50-75),
if(
total amount >75 and
total amount <=100,dual('75-100',75-7100),
if(total amount >100 and total amount <=125,dual('100-125',100-125),
if(
total amount
>150,'Above 150')))) as rangePrice
Resident [product] ;
You can use Class() function.
E.g.
LOAD *, Class(Price,25,'X',25) as [Price Range];
A solution using this is attached.