I'm trying to make a cypher query which does the following
- Find the top 10 largest USA organisations (in terms of revenue)
- Return "True" if an organisation part of the top 10, if not return "False"
My attempted code looks like this to extract list of top 10 organisations is:
MATCH (org)
WHERE org.revenueCurrency = 'USD'
WITH org as topCompany
ORDER by topCompany.revenue desc LIMIT 10
RETURN topCompany
however not sure how to return to True or False if a company is in the top 10
This is one way:
The
top10property of eachresultrow will be a boolean.[UPDATE]
If you want each result row to be "flat" instead of a map, use this altered
RETURNclause: