2 Replies Latest reply: Feb 19, 2018 12:59 AM by Marom Mishan

Hi

My ultimate aim is to calculate bad debt (outstanding for more than 31 days). Currently I managed to make it work with this (1-(Sum([Payment of loan id])/Sum([Loan amount id]))). But the user has to select the last 31 days and exclude them manually each time they want to view bad debt.

//Only({\$<[Loan Date] = {'<=\$(=Max([Loan Date])-31)'}>} (1-(Sum([Payment of loan id])/Sum([Loan amount id])))))

1-(Sum({\$<[Loan Date] = {'<=\$(=Max([Loan Date])-31)'}>}[Payment of loan id])/Sum({\$<[Loan Date] = {'<=\$(=Max([Loan Date])-31)'}>}[Loan amount id]))

So far I get a blank display

Thanks for the help

• ###### Re: Bad debt calculation

Which QS version you are using, I think from Nov release onwards single quote and double quote are not considered identical, try double quote instead of apostrophe, also Loan Date needs to be date type, may be -

1-(Sum({\$<[Loan Date] = {"<=\$(=Max([Loan Date])-31)"}>}[Payment of loan id])/Sum({\$<[Loan Date] = {"<=\$(=Max([Loan Date])-31)"}>}[Loan amount id]))

• ###### Re: Bad debt calculation

Hi digvijay

I tried it.. It didn't work.

1-(Sum({\$<[Loan Date] = {"<=\$(=Max([Loan Date])-31)"}>}[Payment of loan id])/Sum({\$<[Loan Date] = {"<=\$(=Max([Loan Date])-31)"}>}[Loan amount id]))