Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi! I'm pretty new to QV and would like to write a script that does the following:
I have a table with two fields : one date field and one value field - there can be more than 1 row per date with different values for each row.
I want to create a new table where a row = the date field + the sum of all value fields for that date PLUS the sum of the balance fields for all previous dates.
Hope some one can help me with this 🙂 Thanks!
Hi,
You can use this as your expression:-
rangesum(above(sum(Value),0,rowno()))
Thanks & Best Regards,
Kuldeep Tak
Build a table that It's dimension will be the date, the expression is sum(value)
In the expression mark 'Expression Total'
And I think you'll get what you want.
Give it a try..
Thanks! but no that just gives me the total for each date. I want the total for each date PLUS the total for all previous dates in the table
If the original table looks like this for example:
Date1 - 100
Date1 - 200
Date2 - 300
Date2 - 100
Date3 - 500
The new table should look like :
Date1 - 300
Date2 - 700 (400+300)
Date3 - 1200 (500+700)
Hi,
I got your meaning..
Go to properties - Presentation - datefield - and flag 'Show Partial Sums'
The more fields you add it to, the more partial sums you'll have ofcourse..
Okay, I tried that but it still just shows the total for each date, not adding the other sums. I'm using "=Sum(Value)" as expression and the datefield as dimention, have tried both pivot table and straight table
Maybe something with RangeSum would work? Can't figure out how though...
Ok I think I found it
In a straight table you can select Full Accumulation on the Sum(value) expression and it works
🙂
Hi,
You can use this as your expression:-
rangesum(above(sum(Value),0,rowno()))
Thanks & Best Regards,
Kuldeep Tak
Hi mauich,
perhaps you can remember. Take a glance at the straight table expression rangesum. It is similar to the solution of Kuldeep Tuk.
Regards, Roland