2 Replies Latest reply on Aug 23, 2018 5:02 AM by Diego Favoretto

Ratio Calculation using the same Column

Hi All,

I am struggling to create a ratio calculation using data from the same column. e.g. same column contains "deposits", "withdrawal", "refunds" and so on. in a different column there is the amounts. I need to create a calculation that shows the ratios between withdrawal.

Description          Amount

deposit                    103

withdrawal               -300

deposit                     250

deposit                    -100

refund                    -80

cashback                  -150

withdrawal               -500

sum[deposit]/sum[withdrawal]

• 1. Re: Ratio Calculation using the same Column

Good morning

have you tried {fixed : sum(if [Description]="deposit" then (Amount) else 0 end) }  /  {fixed : sum(if [Description]="withdrawl" then (Amount) else 0 end) }

you may need to play with the syntax a bit - didn't have your twbx workbook to check the formula

Jim

If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution.  Thank you.

• 2. Re: Ratio Calculation using the same Column

Jim, thanks for your help.

I ended up creating too calculated fields. one for deposit, the other one for withdraw. then simply deposit/withdraw.

IF Txt = 'deposit' then [Money] END

IF Txt = 'withdraw' then [Money] END

deposit / withdraw

display in %

thanks!!