How can I access the accumulator in SQL-like statement

I have an unexpected error in my query

SumAccum @currentSum;

//get vertex resultset and calculate accum
vertexSet = SELECT p
FROM vertex1:p-(edge1>:e)-vertex2:po
ACCUM p.@currentSum +=1;
//put name and calculated sum into temp table
SELECT pSet.name, pSet.@currentSum INTO vertexNames
FROM vertexSet:pSet ;

But the second query shows an error
(10, 27) Error: An undefined variable pSet in current scope

//interesting, the next one works, when I put accum in WHERE
SELECT pSet.name INTO vertexNames
FROM vertexSet:pSet
where pSet.@currentSum >=0 ;

And in documentation it is said that we can refer to the accumulators in sql-like syntax.
https://docs.tigergraph.com/dev/gsql-ref/querying/select-statement#sql-like-select-statement
Thank you

You haven’t defined pSet in the first example.

Definition of pSet is the same in both examples:

FROM vertexSet:pSet

If I try to put accumulator pSet.@currentSum in select, then it throws an error. Otherwise everything is ok.

Oh I see - it is allowing it in the WHERE clause but not in the SELECT list - that seems very odd