Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
disb | wth | balance |
3000 | 0 | 3000 |
0 | 3000 | 0 |
3000 | 0 | 3000 |
3000 | 0 | 6000 |
0 | 3000 | 3000 |
Dear All
I have a problem how i do this, calculate balance column on run time like balance=disb-wth for first row
and for the remaining rows balance=balance+(disb-wth)
how i reference the first row balance.
Prompt response will be highly appreciated.
Thanks in advance
Hi,
Try like this
Chart - Straight Table
Dimension : Date
Expressions :
Deposit =Sum([disb amt])
Withdrawl =Sum([wth amt])
Balance = Alt(Above([Balance]), 0) + [Deposit] - [Withdrawl]
Please find attached file for reference
Regards,
Jagan.
Create row number while loading the data and use that row num as part of your expression.
Thanks
a:
load *, rowno() as id inline [
disb, wth, balance
3000, 0, 3000
0, 3000, 0
3000, 0, 3000
3000, 0, 6000
0, 3000, 3000
];
b:
NoConcatenate load
*,
disb - wth + alt(peek(newbalance),0) as newbalance
resident a
order by id;
drop Table a;
Thanks for the reply
i dont want to add an line table i do this in pivot table.I have one dimenshion and
the disb and wth are my expressions and i have to calculate the balance on run time like
credit-debit=balance
Hi,
You can do this by using Rangesum() and Above() in expression. If you attach the sample file it would be easier to give solution.
Regards,
Jagan.
Hi Asif,
These can be done at backend level & frontend also -->
In backend reading record level value
In frontend through ABove(),Rangesum()
Regards,
Mukesh Chaudhari
Date | disb amt | wth amt | Balance |
10-07-2012 | 3000 | 3000 | 0 |
14-02-2013 | 3000 | 0 | 3000 |
18-02-2013 | 0 | 3000 | -3000 |
27-06-2013 | 3000 | 0 | 3000 |
16-07-2013 | 0 | 3000 | -3000 |
26-07-2013 | 3000 | 0 | 3000 |
06-08-2013 | 0 | 3000 | -3000 |
28-12-2013 | 3500 | 0 | 3500 |
07-01-2014 | 0 | 3000 | -3000 |
15-03-2014 | 3700 | 0 | 3700 |
21-03-2014 | 0 | 4000 | -4000 |
27-03-2014 | 3600 | 0 | 3600 |
28-03-2014 | 0 | 3500 | -3500 |
05-06-2014 | 3600 | 0 | 3600 |
12-06-2014 | 0 | 3500 | -3500 |
04-09-2014 | 4500 | 0 | 4500 |
08-09-2014 | 0 | 4500 | -4500 |
18-12-2014 | 4500 | 0 | 4500 |
25-12-2014 | 0 | 4500 | -4500 |
35400 | 35000 | 400 |
Thanks for reply
My scenario is like this
disb amt-wth amt = balance
on line three it shows -3000 but according to calculation it shows 0 because on date 14-02-2013, 3000 is disb and on date 18-02-2013 3000 is wth so balance is 0.
Hi,
Try like this
Chart - Straight Table
Dimension : Date
Expressions :
Deposit =Sum([disb amt])
Withdrawl =Sum([wth amt])
Balance = Alt(Above([Balance]), 0) + [Deposit] - [Withdrawl]
Please find attached file for reference
Regards,
Jagan.
Bundle of thanks it works
Hi,
Please close this thread by Clicking Correct and Useful Answer buttons to the useful posts.
REgards,
Jagan.