Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Any help understanding this is very welcome.
I try to count the number of persons which have at least 1 book.
count( {< Book_Id = {*} >} distinct Person_Id )
Because of a mistake (by me), the table with books is empty.
In the data model the table "books" appears, with all it's columns, but no rows.
What I had expected is that the above function would return 0 books, for every person.
In stead, the functions operates similar this function:
count( distinct Person_Id )
The set analysis is ignored, because the table "books" is empty.
Why? This is not what I expected.
Thank you for your interest.
Yes, seems it can't apply selections to field, so set analysis is ignored on that field, there is a workaround applying set analysis to an existing field, something like:
count({<Person_Id={"=Len(Book_Id)>0"}>} distinct Person_Id)
*Not tested
Edit: Btw, I don't know how "really" works, I see it as making selections in fields, and the table is calculated using the resulting dataset, maybe if not selections are applied in one field (as it has no values to select) it's like it doesn't exists.
Hi Ramzi, have you tried?:
count({< Book_Id = {"*"} >} distinct Person_Id)
Thank you for your time,
Yes, is the same.
Normally there're are books, so there's not really a problem.
I'm just trying to understand how it works.
Yes, seems it can't apply selections to field, so set analysis is ignored on that field, there is a workaround applying set analysis to an existing field, something like:
count({<Person_Id={"=Len(Book_Id)>0"}>} distinct Person_Id)
*Not tested
Edit: Btw, I don't know how "really" works, I see it as making selections in fields, and the table is calculated using the resulting dataset, maybe if not selections are applied in one field (as it has no values to select) it's like it doesn't exists.
Thank you, the workaround does work, but your explanation is even more interesting.