Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am using an aggregation function and I am having problems in some cases.
The syntax that is not working is these:
sum(aggr(only(OpenValue),Document,DueDate)
+if(PaymentDate>AsOfDate,PayedValue,0))
If I take out the aggregation function gives the correct number:
sum(if(PaymentDate>AsOfDate,PayedValue,0))
Why the aggreation function is changing my results?
I don't think you can add an aggregation to an if statement. An aggregation returns a list of rows. The IF statement returns a single value. You can't add a single value to a list of rows.
I have no idea what you're actually trying to accomplish, but my guess is that you either need to move the IF inside the aggregation, or move the + outside of the sum.
I don't think you can add an aggregation to an if statement. An aggregation returns a list of rows. The IF statement returns a single value. You can't add a single value to a list of rows.
I have no idea what you're actually trying to accomplish, but my guess is that you either need to move the IF inside the aggregation, or move the + outside of the sum.