Quantcast
Channel: SCN : All Content - Data Services and Data Quality
Viewing all articles
Browse latest Browse all 4013

Need a Logic for balance

$
0
0

Hi Experts,

 

I have a table

SSN          data            balance paid_amount rank
111111111    1st week date   1000     100         1
111111111    2nd week date   1000     100         2
111111111    3rd week date   1000     100         3
111111122    1st week date   1000     100         1
111111122    2nd week date   1000     100         2
111111122    3rd week date   1000     100         3


I want the output as

SSN          data            balance New_balance
111111111    1st week date   1000     1000        
111111111    2nd week date   1000     900        
111111111    3rd week date   900      800        
111111122    1st week date   1000     1000        
111111122    2nd week date   1000     900        
111111122    3rd week date   900      800        

For first New_balance values will be same as balance
for second week balance = new_balance and new_balance = balance-paid_amount
for third  week balance = new_balance and new_balance = balance-paid_amount

 

I am using data service version 4.1

 

Need a Logic to perform above

 

Thanks

Madhu


Viewing all articles
Browse latest Browse all 4013

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>