Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Bad debt calculation

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

2 Replies
Digvijay_Singh

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]))

Anonymous
Not applicable
Author

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]))