Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have 4 fields that I need to sum, but this doesn't work since there can be many negative values, and that calculates wrong in in the script.
this is what the calc looks like in the load script:
Income - (Adjust+Payments+ Credits)) as Amount
Income is always positive. Adjustments, Payments and credits can be either positive and/or negative.
Thanks for quick reply
How do you want to handle the negative values? Use the absolute values instead or setting the value to zero?
Income - (fabs(Adjust)+fabs(Payments)+ fabs(Credits))) as Amount
or
Income - (rangemax(Adjust,0)+rangemax(Payments,0)+ rangemax(Credits,0))) as Amount
Hi,
Can you attach some sample data and your expected result?
Regards,
Jagan.
Try this
Income - fabs(Adjust) - fabs(Payments) - fabs(Credits)