Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good day everyone,
to convert this syntax from set analysis to script (during load)
=Count({< Active={1},Location={Canada','*Can*'}>} Distinct EmpNo)-Count({< Terminated={1},Location={'Canada','*Can*'}>} Distinct EmpNo)
- where Active is record tag as active employee, same goes to Terminated (tag)
- Location is a field
- EmpNo is Employee number
syntax is count Emp No if the employee is active and if location is Canada - count if terminated and location is canada
Regards,
It's quite hard to convert a chart expression to an aggregation in the script without knowing the context, i.e. your chart expression will still be sensitive to user selections and also consider the dimensional aggregation scope.
edit:
If all fields are within the same table and you want to calculate in global context (no selections, no dimensions), maybe something like
LOAD
Count(DISTINCT If(Active=1,EmpNo)) - Count(DISTINCT If(Terminated = 1, EmpNo)) as Result
RESIDENT YourTable
WHERE WildMatch(Location, '*Can*');
Thanks Stefan,
I will try this solution.
Regards,