Hello.
I have a table the table โStudentsโ, and another table โGroupEventsโ in which there are two relevant columns: The column โGroupโ contain lists of students names (from enum list input) and the other is called โScoreโ and contains a numeric value for each group.
Now, I want to create a new virtual column in the studentsโ table, with the sum of the scores per student.
I wrote the following expression:
sum(select(GroupEvents[Score],in([_thisrow].[StudentName],[Group])))
It keeps return zeros for every student, no matter how many times he has a score with a group.
Iโm struggling with it for a few days and nothing. Can someone help me see what Iโm missing?
Thanks!
Solved! Go to Solution.
Your enumlist should be basetype ref and point to the students table. Then the Label will be shown, I guess that the Name is the label in that table
Are you sure that the [Score] column is formatted as number and not as text?
Yes. I made sure of it.
So far I know, Enum returns text (default), so you can try to convert the text to number by using the function NUMBER().
Hi.
It is of type Number. please see my reply below.
If the EnumList called [Group]
is on the table GroupEvents, itโs basetype Ref and is pointing to the Students table, try:
SUM(
SELECT(
GroupEvents[Score],
IN(
[_THISROW],
[Group]
)
)
)
Thanks, but the items inside each โgroupโ recording are not the key from the table students (not the ID but the names. I guess this is where the problem begins.
Your enumlist should be basetype ref and point to the students table. Then the Label will be shown, I guess that the Name is the label in that table
Iโve just tested it again. The sumation without the condition works fine and returns a numeric value (sum of all the scores in the GroupEvents table. It is the condition which isnโt working. It looks like it canโt find studentName inside the enum list in the column group.
Iโve tried FIND(), IN(), CONTAINS() and nothing works. Is it because these expressions work only on type text and not on enum lists?
I guess I still need your help
User | Count |
---|---|
41 | |
36 | |
28 | |
23 | |
16 |