Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have below data :
If customer paid extra we should count only the required amount as Final payment
for example customer bill is : 50 and he paid 150 we consider only 50 as Final payment
below formula work fine in the table :
if((Sum(Payment_Amount)-Account_Balance) >= 0 , Account_Balance , sum(Payment_Amount))
Company | Account_Balance | Payment_Amount | Final_Payment |
Company 1 | 10 | 8 | 8 |
Company 1 | 12 | 14 | 12 |
Company 1 | 3 | 3 | 3 |
Company 1 | 16 | 20 | 16 |
Company 1 | 20 | 20 | 20 |
Company 1 | 33 | 35 | 33 |
Company 1 | 100 | 500 | 100 |
now I need to create a small table with the total of final amount example :
Company | Total Final_Payment |
Company 1 | 192 |
I try to add in the load script below formula :
if((Sum(Payment_Amount)-Account_Balance) >= 0 , Account_Balance , Payment_Amount) as Final_payment,
unfortunately it doesn't work gives error :