Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I need calculate numbers of orders that have "returns" more than 6.
Previously for this I used following expression:
Count({<Returns={"<6"}>}Orders)
Week ago we moved to new dataset and we haven't "returns" in DB. Also after this, it's not possible to calculate returns in the script, so I create set expression for returns: $(eReturns)
The question is following: How can I change my Count calculation to make it works with calculated expression?
Hi Vitalii, can you show this expression eReturns?
Hi
You said that "returns" more than 6.
But your set expression is for "returns" less than 6. Try this way
Count({<Returns={"=Returns > 6"}>}Orders)
OR
Count({<Returns={"> 6"}>}Orders)
Both are fine in your case.
May be this
Count({<Orders={"=$(eReturns) < 6"}>} Orders)
eReturns is:
Sum({<Date = {">=$(vStart) <=$(=vEnd)"}>}[Issued Quantity])
/(Sum({<Date = {"<=$(vStart)"}>}[Received Quantity])-Sum({<Date = {"<=$(vStart)"}>}[Issued Quantity]))
Unfortunately, it doesn't work
I guess since your expression includes double quotes, the double quote within the double quote failed... try this may be
Count({<Orders={[=$(eReturns) < 6]}>} Orders)
Please check if it is working -
Count({<Orders={
"=$(=(Sum({<Date = {">=$(vStart) <=$(=vEnd)"}>}[Issued Quantity])
/(Sum({<Date = {"<=$(vStart)"}>}[Received Quantity])-Sum({<Date = {"<=$(vStart)"}>}[Issued Quantity]))
)
)
< 6"
}>} Orders)
I don't think this will work jayanttibhe because of multiple reasons
1) You have double quotes within double quotes. You need to either use an escape sequence or use a differ thing for beginning double quote
2) You have a dollar sign expansion in the set modifier which will compare Order to a single value. I don't think that will work