-
Simple Query against Datamart.
-
Provides table from
.tables()in.datamart().
Code
Groovy
def qapi = api.queryApi()
def exprs = qapi.exprs()
def t1 = qapi.tables().datamart("Gapminder")
return qapi.source(t1, [t1.Country, t1.Fertility, t1.Population, t1.Year],
exprs.and(
t1.Country.equal("Canada")
)
)
.stream { it.collect { it } }
Result
|
Country |
Fertility |
Population |
Year |
|---|---|---|---|
|
Canada |
1.7 |
33,327,954 |
2008 |
|
Canada |
1.7 |
33,675,448 |
2009 |
|
Canada |
1.6 |
34,016,593 |
2010 |
|
Canada |
1.6 |
34,349,561 |
2011 |
|
Canada |
1.7 |
34,674,708 |
2012 |
|
Canada |
1.7 |
34,993,747 |
2013 |