Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Team,
I have a below table.
PH6 | PH6_desc | Sales T/O |
231546 | BV 546 | 1163729 |
255373 | VAG Produkte | 1092099 |
221051 | El. fusion fitti. PB | 880487 |
201950 | Solv.cement fitt.me. | 874874 |
230152 | Solv. Cement Fit. mm | 689215 |
202956 | Ballvalves for water | 550592 |
230153 | Adapter Fittings mm | 531082 |
251313 | ELGEF Plus saddles | 464251 |
221043 | Pipe PB in bars | 451753 |
2J1J54 | Regulierarmaturen | 432843 |
Further I want to add new column as below. Kindly help me in doing this.
PH6 | PH6_desc | Sales T/O | New Column | Description |
231546 | BV 546 | 1163729 | 1163729 | For the first row the value should be same as Sales T/O(1163729) |
255373 | VAG Produkte | 1092099 | 2255828 | Addition of 1st row and 2nd row of Sales T/O(1163729+1092099) |
221051 | El. fusion fitti. PB | 880487 | 3136315 | 880487+2255828 |
201950 | Solv.cement fitt.me. | 874874 | 4011189 | 874874+3136315 |
230152 | Solv. Cement Fit. mm | 689215 | 4700404 | 689215+4011189 |
202956 | Ballvalves for water | 550592 | 5250996 | 550592+4700404 |
230153 | Adapter Fittings mm | 531082 | 5782078 | 531082+5250996 |
251313 | ELGEF Plus saddles | 464251 | 6246329 | 464251+5782078 |
221043 | Pipe PB in bars | 451753 | 6698082 | 451753+6246329 |
2J1J54 | Regulierarmaturen | 432843 | 7130925 | 432843+6698082 |
You are not using the expression which I suggested in my previous post. Try that. If not working please share sample application
Hello,
I have tried your expression as well.
Script.
Table:
LOAD * Inline [
PH6 ,PH6_desc, Sales T/O
231546,BV 546,1163729
255373,VAG Produkte,1092099
221051,El. fusion fitti. PB,880487
201950,Solv.cement fitt.me.,874874
230152,Solv. Cement Fit. mm,689215
202956,Ballvalves for water,550592
230153,Adapter Fittings mm,531082
251313,ELGEF Plus saddles,464251
221043,Pipe PB in bars,451753
2J1J54,Regulierarmaturen,43284
];
Please find the attached file..
Do some changes.
First Remove Sales T/O from dimension and add it via measure (Sum([Sales T/O])) as it is measure. Now use below expression
RangeSum(above(total sum({<PH6,PH6_desc>}[Sales T/O]),0,RowNo(total))) *avg(1)
Hello,
As per your suggestion, I changed the expression and I got the output.
But I want to sort the Sales T/O field in descending order.. But I am unable to do it.
I can Only sort PH6 and PH6_desc fields.
Any suggestion??
you need to use sortable Aggr for this.
your final expression will look like below
=sum(aggr(RangeSum(above(total sum({<PH6,PH6_desc>}[Sales T/O]),0,RowNo(total))) ,([Sales T/O],(NUMERIC, ASCENDING)))) *avg(1)
Thanks for the reply,
Please find the attached file. Im getting the wrong output.:(
What is the expected output when you sort it descending? Accumulation should start with Highest value?
I should sort the Sales T/o column in descending order.
corresponding to the sales T/O column i should get the new column value(Cumulative T/O).
PH-6 | PH-6 name | Sales T/O | Cumulative T/O |
231546 | BV 546 | 1,163,729 | 1,163,729 |
255373 | VAG Produkte | 1,092,099 | 2,255,828 |
221051 | El. fusion fitti. PB | 880,487 | 3,136,315 |
201950 | Solv.cement fitt.me. | 874,874 | 4,011,189 |
230152 | Solv. Cement Fit. mm | 689,215 | 4,700,404 |
202956 | Ballvalves for water | 550,592 | 5,250,996 |
230153 | Adapter Fittings mm | 531,082 | 5,782,077 |
251313 | ELGEF Plus saddles | 464,251 | 6,246,328 |
221043 | Pipe PB in bars | 451,753 | 6,698,081 |
try changing (FREQUENCY, DESCENDING) to (NUMERIC, DESCENDING) in aggr function
I tried but no luck..:(