Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm creating a table with the margin of the orders_:
SALESID MArgin
A 10
B -5
C 7
Where Margin is a calculated field: Sales - Cost
I wanna know how many orders are posite or negative and I applied this formula, but it give me an error:
Count(Distinct IF([Margin]>='0', SALESID))
any knows why?
Many thank's
Eduard
How about this:
Count({<[Margin] = {">=0"}>} Distinct SALESID)
I also realized that in your formula you are using '0' as text, not as a number 0
Try it without the single quotes
and are you counting SALESID or ORDERID? Make sure to use the correct field name
=Count(Distinct If(Margin >= 0, SALESID))
or
=Count(Distinct If(Margin >= 0, ORDERID))
did not works 😞
Hi
I'm counting SalesId, sorry, but the formula did not works returns to me independently if Margin is positive or negative
Margin is a field which is getting calculated in the script? We both are assuming that it is, if it is not, then we might need to use other fields.
Hi Sunny
No, the margin is calculated in the table not in the script
Dimension: SalesID
Margin= Sales - Cost
Many thank's
Try this:
=Count(Distinct If((Sales - Cost) >= 0, SalesID))
count( {$ <SALESID={"=Sales>Cost"}>} SALESID)
The Margin chart column may not be used in a aggregation function count(). You will need to repeat the expressions that computed the Margin.
-Rob