Query Cities w/Enrichment
Let's triple spice it and add Zoomers, Moomers (Millenials need a trendier name), and Boomers in addition to our price feed data for one common set of analysis.
Key Notes
- We layer on census underneath the cities breakouts
- Add Census data such as Boomers_Female_Population
- Include TOTAL_POPULATION to calculate percentages
- Only want the most recent year of Census, order_by YEAR in desc and limit 1
query MyQuery {
MSA(where: {MSA_NAME: {_eq: "New York-Newark-Jersey City, NY-NJ-PA"}}) {
MSA_NAME
parcl_price_feed_aggregate(limit: 14, order_by: {DATE: desc}) {
aggregate {
avg {
PARCL_PRICE_FEED
}
}
}
cities(limit: 2, order_by: {CITY_NAME: asc}) {
CITY_NAME
parcl_price_feed(limit: 3, order_by: {DATE: desc}) {
PARCL_PRICE_FEED
DATE
}
census(limit: 1, order_by: {YEAR: desc}) {
Boomers_Female_Population
Boomers_Male_Population
Millennial_Male_Population
Millennial_Female
Gen_Z_Female_Population
Gen_Z_Male_Population
POP_TOTAL
}
}
}
}
Results
{
"data": {
"MSA": [
{
"MSA_NAME": "New York-Newark-Jersey City, NY-NJ-PA",
"parcl_price_feed_aggregate": {
"aggregate": {
"avg": {
"PARCL_PRICE_FEED": 323.92405795264
}
}
},
"cities": [
{
"CITY_NAME": "Airmont",
"parcl_price_feed": [
{
"PARCL_PRICE_FEED": 341.3143958152173,
"DATE": "2022-10-21"
},
{
"PARCL_PRICE_FEED": 337.0259137499999,
"DATE": "2022-10-20"
},
{
"PARCL_PRICE_FEED": 336.15947946739124,
"DATE": "2022-10-10"
}
],
"census": [
{
"Boomers_Female_Population": 3844,
"Boomers_Male_Population": 3684,
"Millennial_Male_Population": 2569,
"Millennial_Female": 2605,
"Gen_Z_Female_Population": 3887,
"Gen_Z_Male_Population": 3857,
"ESTIMATE_TOTAL_POPULATION": 34532
}
]
},
...
}
}
Results
Updated 3 months ago