Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I'm struggling in getting the total row by row.
We have value for each month and also value for the total, loaded in script.
Is there a way to loop in the front end through each row and get the total.
Currently I'm getting the total sum of all values in the table. I would need to get the total for each line.
if((month='Total'),
sum(TOTAL aggr((sum({<month=-{'Total'}>}nt)/sum({<month=-{'Total'}>}numva)),month,identifier))
,sum({<month=-{'Total'}>}nt)/sum({<month=-{'Total'}>}numva))
Thanks to anybody that can help
Try this
If(SecondaryDimensionality() > 0,Sum(Value),
RangeSum(First(Sum(Value),1,NoOfColumns())))
and set Partial TOTAL in Month
You mean this?
If(month = 'Total', 'TOTAL' & Expression, Expression1)
ID | Total | January | February | March | April | May | June | July | August | September | October | November | December |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5558 | 28.77 | 1.37 | 2.74 | 2.74 | 4.11 | 0.00 | 2.74 | 0.00 | 2.74 | 4.11 | 5.48 | 0.00 | 2.74 |
5559. | 38.30 | 1.42 | 2.84 | 3.55 | 4.26 | 2.13 | 2.13 | 2.13 | 3.55 | 7.09 | 3.55 | 2.13 | 3.55 |
5560 | 37.50 | 4.17 | 4.17 | 8.33 | 5.56 | 4.17 | 2.78 | 0.00 | 0.00 | 4.17 | 1.39 | 1.39 | 1.39 |
Sorry, my mistake.
Total has to be as in the previous table.
Now it's being calculated as:
sum(TOTAL aggr((sum(nt)/sum(numva)),month,identifier))
With this I would get:
The sum of: 28.77+38.30+37.50
ID | Total | January | February | March | April | May | June | July | August | September | October | November | December |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5558 | 104.56 | 1.37 | 2.74 | 2.74 | 4.11 | 0.00 | 2.74 | 0.00 | 2.74 | 4.11 | 5.48 | 0.00 | 2.74 |
5559. | 104.56 | 1.42 | 2.84 | 3.55 | 4.26 | 2.13 | 2.13 | 2.13 | 3.55 | 7.09 | 3.55 | 2.13 | 3.55 |
5560 | 104.56 | 4.17 | 4.17 | 8.33 | 5.56 | 4.17 | 2.78 | 0.00 | 0.00 | 4.17 | 1.39 | 1.39 | 1.39 |
Hope it's more clear now loveisfail
Try this
If(SecondaryDimensionality() > 0,Sum(Value),
RangeSum(First(Sum(Value),1,NoOfColumns())))
and set Partial TOTAL in Month
Thanks, but no luck
Only get the avg for each one
If(SecondaryDimensionality() > 0,(sum(nt)/sum(numva)),
RangeSum(First((sum(nt)/sum(numva)),1,NoOfColumns())))
Antonio,
I was working on your response and finally got what I needed based on your query.
if(month='Total'
,RangeSum(First(sum({<month=-{'Total'}>}nt)/sum({<month=-{'Total'}>}numva),1,NoOfColumns()))
,sum({<month=-{'Total'}>}nt)/sum({<month=-{'Total'}>}numva))
Thanks!!!