Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm struggling with quite a basic problem: What is the correct syntax when using multiple variables in an expression?
E.g.:
=Num(Count({$<[Receipt Time Difference]={">=1"}>} [Trade ID])/Count([Trade ID]),'##.##%')
works, but only after I defined Receipt Time Difference on load. I wanted to use something like
=Num(Count({$<[Receipt To]-[Receipt From]={">=1"}>} [Trade ID])/Count([Trade ID]),'##.##%')
but couldn't get any ()/[]/{}/$ combination to work. What would have been the correct syntax here?
Thanks!
In a set expression, you can use only [edit: single] field names left from the equal sign [edit: no calculations / expressions], so it would really be appropriate and performant to calculate this field in the script.
[edit:] You can maybe use a set expression with an advanced search, but the performance would be worse than using a precalculated field.
In a set expression, you can use only [edit: single] field names left from the equal sign [edit: no calculations / expressions], so it would really be appropriate and performant to calculate this field in the script.
[edit:] You can maybe use a set expression with an advanced search, but the performance would be worse than using a precalculated field.
You're better off calculating the difference in the script. But perhaps this will work:
=Num(Count({$<[Trade ID]={'=[Receipt To]-[Receipt From]>=1'}>} [Trade ID])/Count([Trade ID]),'##.##%')
It is not possible to do directly what you have written, you should build a field (in the script) that computes [Receipt To]-[Receipt From] and then use that new field in your set analysis
Hope it heklps
Great, thank you!
Guess I'll have to do it this way then.
Sorry, I don't understand.
Looks like your expression already uses a single field name Spilled from your data model, just selecting value 1.
edit: and yes, aliasing the field spilled to Spilled will work, if spilled is part of your input table.
edit