He attribute of an universal vertex type variable cannot be accessed

Hello Reader, Thanks for reading it!

I have just started with TigerGraph. I have a very question but I am not able to resolve it.

I want to add the marks of the students until their total crosses to 50. I have written the code but getting the below error.
subs = SELECT a FROM Start:a ACCUM @@Results +=a;
FOREACH i IN @@Results DO

if c<50 THEN @@Results_fin +=i; end;
if c<50 THEN c +=i.score; end;

END;

Error: Error: The attribute of an universal vertex type variable cannot be accessed.

How can I add the scores here?

Thanks in Advance!

I guess you define @@Results like SetAccum<vertex> @@Results.
You can try to define @@Results like SetAccum<vertex<your_vertex_type>> @@Results.

You should be more specific on what you are trying to do.

For instance, what are the vertex types and attributes? Where are the student scores being stored?
Your example doesnt really make much sense, and its not clear what c is for or what @@Results is for.

You will get great suggestions if you clarify your problem a bit better

1 Like