Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Can any one explain the following statement
sum(if(YTD, SalesPrice))
Thanks in advance!
Hi
the statement calculates the Sum of SalesPrice having YTD = -1 (that is true)
Hi
the statement calculates the Sum of SalesPrice having YTD = -1 (that is true)
Thanks for the reply.
So, if we dont give any condition, it means true.
Thanks again!
No there is a condition, the condition is everything before the first "," in the if()-statement.
In this case it happens to be just a field (or variabel) named YTD
YTD can have all kind of values
What you do not have in this case is an "else"-expression.
Ok, great. Let me rephrase it.
sum(if(YTD, SalesPrice))
If YTD is 1 it will calculate Sum(Salesprice) or If YTD is true it will calculate Sum(Salesprice)
If YTD is 0 it will do nothing or If YTD is false it will do nothing
Is this correct?
almost
If YTD is -1 it will calculate Sum(Salesprice)
also I do not know how it is in your case,
YTD can be a field that has a connection to Salesprice
and in that case the Sum will only include those Salesprices where YTD is true
hth
Sounds good. Thanks for your time.
Have a good one.