Hello,
I have a table named MEDECINS whose key column named ID MEDECIN only contains unique id values.
I have an expression that looks like this :
COUNT(SELECT(MEDECINS[ID MEDECIN], long select-row expression)
Even though the MEDECINS[ID MEDECIN] column contains uniqueid values (it is the key column),
i get two different values depending on if i add ,TRUE as a [ , distinct-only? ] parameter in my select () expression or not. I would like to understand why I get two different values depending on if i add ,TRUE or not.
In my mind it shouldn't make a difference because there are no duplicate values in the ID MEDECIN column that is being evaluated.
Thank you very much in advance for your lightings.
Best regards,
Solved! Go to Solution.
I don't know, I'll suggest some ways to troubleshoot:
So what happens with the following two expressions?
COUNT(SELECT(MEDECINS[ID MEDECIN], TRUE))
and
COUNT(SELECT(MEDECINS[ID MEDECIN], TRUE, TRUE))
Do they give different answers?
Hello Graham.
My expression:
COUNT(SELECT(MEDECINS[ID MEDECIN], select-row conditions)
and
COUNT(SELECT(MEDECINS[ID MEDECIN], select-row conditions, TRUE)
give different answers.
I am trying to firgure out why it gives different answers.
In my mind it should not give different answers because there are no duplicate values in the ID MEDECIN column that is being evaluated.
When I omit ',TRUE' (as a [ , distinct-only? ] parameter), some values are returned more than once.
Hello @Majeed,
Your reply is exactly the same as the original post. Would you please instead perform the test that @graham_howe suggested and post screenshots of the results? Thanks in advance.
@graham_howe wrote:So what happens with the following two expressions?
COUNT(SELECT(MEDECINS[ID MEDECIN], TRUE))
and
COUNT(SELECT(MEDECINS[ID MEDECIN], TRUE, TRUE))
Do they give different answers?
Thank you @Former Community Member and @Joseph_Seddik for your messages.
Here are the two full expressions and screenshots of their respective resuts
WITHOUT ",TRUE":
COUNT(SELECT(MEDECINS[ID MEDECIN],
AND(
[ID CIRCUIT].[NOM COMPLET VISITEUR]=[_THISROW].[NOM COMPLET VISITEUR],
[STATUT]<>Interne,
IN([ID MEDECIN],SELECT(VISITE MEDICALE[ID MEDECIN],
AND(
[NOM COMPLET VISITEUR]=[_THISROW].[NOM COMPLET VISITEUR],
YEAR([DATE ET HEURE CHECK IN])=[_THISROW].[ANNEE],
MONTH([DATE ET HEURE CHECK IN])=[_THISROW].[MOIS]
)
))
)
))
RESULT:
WITH ",TRUE":
COUNT(SELECT(MEDECINS[ID MEDECIN],
AND(
[ID CIRCUIT].[NOM COMPLET VISITEUR]=[_THISROW].[NOM COMPLET VISITEUR],
[STATUT]<>Interne,
IN([ID MEDECIN],SELECT(VISITE MEDICALE[ID MEDECIN],
AND(
[NOM COMPLET VISITEUR]=[_THISROW].[NOM COMPLET VISITEUR],
YEAR([DATE ET HEURE CHECK IN])=[_THISROW].[ANNEE],
MONTH([DATE ET HEURE CHECK IN])=[_THISROW].[MOIS]
)
))
)
,TRUE))
RESULT:
Would you please just test with
COUNT(SELECT(MEDECINS[ID MEDECIN], TRUE))
and
COUNT(SELECT(MEDECINS[ID MEDECIN], TRUE, TRUE))
and show the results?
Thank you..
Dear @Joseph_Seddik
I just tested with
COUNT(SELECT(MEDECINS[ID MEDECIN], TRUE))
and
COUNT(SELECT(MEDECINS[ID MEDECIN], TRUE, TRUE))
The two expressions return the exact same result, below:
I don't know, I'll suggest some ways to troubleshoot:
I suggest you review your spreadsheet. I suspect there are, in fact, duplicate key column values.
Also, just to add a litle to this conversation, Select(Table[Key]) is not actually the best tool for the job.
There is Filter() with that.
If Filter() returns the same problem, your worksheet is the problem.
BTW, I don't know if blank values are considered, but maybe you deleted rows and they are considered the same key (blank)
Thank you all for your answers and support.
User | Count |
---|---|
43 | |
26 | |
23 | |
14 | |
13 |