# Regarding With Clause in Cypher Query in Neo4j 4x

**URL:** <https://community.neo4j.com/t/regarding-with-clause-in-cypher-query-in-neo4j-4x/75861>\
**Category:** Cypher\
**Tags:** cypher\
**Created:** [November 7, 2025, 7:28am UTC](https://community.neo4j.com/t/regarding-with-clause-in-cypher-query-in-neo4j-4x/75861 "2025-11-07T07:28:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tulika.munshi](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/tulika.munshi/32/34728_2.png) [@tulika.munshi](https://community.neo4j.com/u/tulika.munshi)\
**Post date:** [November 7, 2025, 7:28am UTC](https://community.neo4j.com/t/regarding-with-clause-in-cypher-query-in-neo4j-4x/75861/1 "2025-11-07T07:28:00Z")

</div>

Hi,

I am trying to run following cypher query in Neo4j (version 4.4.5)

CALL  
{  
MATCH (n:NEO\_OBJECT) RETURN n.name  
}  
WITH n.name  
WHERE n.name = 'Test Object 8'  
RETURN n.name

However I get the error - "Variable `n` not defined (line 5, column 6 (offset: 54))  
"WITH n.name"

I am aware that this problem can be resolved by using “as” with the return clause like “ RETURN n.name as newname” and then use newname with WITH clause.

But if I do not want to use an alias, then is there a way to use WITH clause with a dot(.) as above?

Thanks!

---

<div class="post-metadata">

**Author:** ![therese.magnusson](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/therese.magnusson/32/32815_2.png) [@therese.magnusson](https://community.neo4j.com/u/therese.magnusson)\
**Post date:** [November 7, 2025, 8:45am UTC](https://community.neo4j.com/t/regarding-with-clause-in-cypher-query-in-neo4j-4x/75861/2 "2025-11-07T08:45:50Z")

</div>

Hi, you can escape the variable in your with/where/return clauses

```auto

CALL
{
  MATCH (n:NEO_OBJECT) RETURN n.name
}
WITH `n.name`
WHERE `n.name` = 'Test Object 8'
RETURN `n.name`

```

and then I believe it should work to have the `.` in the variable name without renaming it explicitly (there is an implicit `AS `n.name`` in the RETURN in the CALL)

/Therese

---

<div class="post-metadata">

**Author:** ![glilienfield](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/glilienfield/32/27534_2.png) [@glilienfield](https://community.neo4j.com/u/glilienfield)\
**Post date:** [November 7, 2025, 12:50pm UTC](https://community.neo4j.com/t/regarding-with-clause-in-cypher-query-in-neo4j-4x/75861/3 "2025-11-07T12:50:57Z")

</div>

This will work:

```auto
CALL
{
  MATCH (n:NEO_OBJECT) RETURN n
}
WITH n
WHERE n.name = 'Test Object 8'
RETURN n.name

```

But there is no need to use a call subquery. The following is the proper way:

```auto
MATCH (n:NEO_OBJECT)
WHERE n.name = 'Test Object 8'
RETURN n.name

```

OR, with implied ‘where’ clause:

```auto
MATCH (n:NEO_OBJECT {name: 'Test Object 8'})
RETURN n.name

```

A call subquery is great if you want to run a complex operation on each line of a match result and return just the result. The result can be one or more lines and will be appended with the row of data that involved the call.
