---
# System prepended metadata

title: Untitled

---

## Goal

Help user understand breakdown of their most valuable (and least valuable) community members.

## Visual

![](https://i.imgur.com/ur2dLSE.png)


## Query

// return top two personas + counts

```
match
    (wallet)-[:HOLDS]->(t:Token)-[:_HAS_MEMBERSHIP_TOKEN]-(element:_Element {communityId: $communityId})
match
    (wallet:Wallet)-[r:_HAS_CONTEXT]->(context:_Context)-[:_HAS_CONDITION]-(condition:_Condition)
where not
    (wallet)-[:_HAS_CONTEXT]->(:_IncentiveFarming)
with
    condition, count(distinct(wallet)) as count_wallets
return
    {
        condition: condition._displayName,
        count: count_wallets
    }
order by
    count_wallets desc
limit 
    2
```

// return treemap chart data

```
match
    (wallet)-[:HOLDS]->(t:Token)-[:_HAS_MEMBERSHIP_TOKEN]-(element:_Element {_communityId: "porCom184353"})
match
    (wallet:Wallet)-[r:_HAS_CONTEXT]->(context:_Context)-[:_HAS_CONDITION]-(condition:_Condition)
where not
    (wallet)-[:_HAS_CONTEXT]->(:_IncentiveFarming)
with
    context._displayName as displayName,
    count(distinct(wallet)) as count_wallets
order by
    count_wallets desc 
limit 10
with 
    collect(distinct({
        label: displayName,
        count_wallets: count_wallets
    }))
as superstars
match
    (wallet)-[:HOLDS]->(t:Token)-[:_HAS_MEMBERSHIP_TOKEN]-(element:_Element {_communityId: "porCom184353"})
match
    (wallet:Wallet)-[r:_HAS_CONTEXT]->(context:_Context:_IncentiveFarming)-[:_HAS_CONDITION]-(condition:_Condition:_IncentiveFarming)
with
    context._displayName as displayName,
    count(distinct(wallet)) as count_wallets,
    superstars
order by
    count_wallets desc 
limit 10
with 
    collect(distinct({
        label: displayName,
        count_wallets: count_wallets
    }))
as farmers, superstars
match
    (boring)-[:HOLDS]->(t:Token)-[:_HAS_MEMBERSHIP_TOKEN]-(element:_Element {_communityId: "porCom184353"})
where not
    (boring)-[:_HAS_CONTEXT]->()
with
    farmers, superstars, count(distinct(boring)) as no_category_count

return
    {
        farmers: farmers,
        superstars: superstars,
        no_categories: no_category_count 
    
    }
```