Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Multiple ID's contain list of Users and from the list of ID's When I select one, I want to Identify:
1. All users belonging to the selected Id.
2. Check which of them also appear in any other Id (excluding the selected)
3. Calculate the percentage of overlap user's vs all the users in the selected Id.
I am facing errors in set expression for 2nd and 3rd requirement. Appreciate any help with this.
Maybe using p() and/or e() to refer against the current selection state. Take the following as starting point:
1. concat(distinct User, ' + ')
2. concat({< ID = e(ID), User = p(User) >} distinct ID & ' - ' & User, ' + ')
3. count({< ID = e(ID), User = p(User) >} distinct User) / count(distinct User)
whereby you may need to consider some further conditions and/or also to nest them - means that something like: ... p({< ID = e(ID) >} User) ... is a valid possibility and may necessary to fetch the wanted sub-set.
Maybe using p() and/or e() to refer against the current selection state. Take the following as starting point:
1. concat(distinct User, ' + ')
2. concat({< ID = e(ID), User = p(User) >} distinct ID & ' - ' & User, ' + ')
3. count({< ID = e(ID), User = p(User) >} distinct User) / count(distinct User)
whereby you may need to consider some further conditions and/or also to nest them - means that something like: ... p({< ID = e(ID) >} User) ... is a valid possibility and may necessary to fetch the wanted sub-set.
i used the expression below for the scenario 2 for fetching the users who are present in other Emp_id’s apart from the selected one.
count({ <[user]=P({<Emp_id={“(=only(Emp_id))"}>} [user]),Emp_id-={"$(=only(emp_id))"}}distinct [user])
but shows an error in expression.
There are several syntax and logic issues:
count({ <[user]=P({<Emp_id={“$(=only(Emp_id))"}>} [user]),Emp_id -={"$(=only(Emp_id))"}>}distinct [user])
especially regarding to only() which is seldom necessary and in all other cases only error-prone.
Before combining and nesting the conditions apply e() and p() - wrapped with count and concat - separat against user and Emp_id to see how they behave with which selections. Getting the wanted intersection could be logically quite complicated and needs of course an appropriate data-model + data-set. Therefore developing it step by step is simpler as resolving issues in the final approach.
One insight might be that a nesting mustn't be mandatory else that the results might be reached with an approach like:
count({ Set 1 } Field) * sign(count({ Set 2} Field))
whereby the right sides acts as a boolean flag.
The 2nd expression throws an error that “ Error in set modifier P function parameter list.