Retrieve Data With Aggregate Functions Task In Backendless Mission

Mission: DATA MINER
Task: Retrieve Data With Aggregate Functions

I have done this task in the Rest Consul. Is that correct? Anyway have not got the mission complete response on the correct assignment.

Hello @Ove_Eriksson,

This task should be done directly in browser. Please check this video tutorial to complete the Retrieve Data with Aggregate Functions mission.

Regards,
Olha

I have no tried this 5 times and I think it OK. But no revord. Please check this URL:s for confirmation.

https://eu-api.backendless.com/91FA5AE8-176D-11C0-FF77-476BEA71C900/856F2D80-C685-44C0-AE1D-53A15F7B08D1/data/Country?property=LifeExpectancy&property=Continent&property=Min(`objectId`)%20as%20MinLifeExpectancy&sortBy=`Continent`%20desc&groupBy=`Continent`

https://eu-api.backendless.com/91FA5AE8-176D-11C0-FF77-476BEA71C900/856F2D80-C685-44C0-AE1D-53A15F7B08D1/data/Country?property=Continent&property=objectId&property=Count(`objectId`)%20as%20CountryCount%2C%20Continent&sortBy=`Continent`%20desc&groupBy=`Continent`

Hi @Ove_Eriksson,

your request should contain both MinLifeExpectancy and CountryCount.

Regards,
Stanislaw

Here is for the MinLifeExpectancy:

[{"___class":“Country”,“Continent”:“South America”,“MinLifeExpectancy”:62.9},{"___class":“Country”,“Continent”:“Oceania”,“MinLifeExpectancy”:59.8},{"___class":“Country”,“Continent”:“North America”,“MinLifeExpectancy”:49.2},{"___class":“Country”,“Continent”:“Europe”,“MinLifeExpectancy”:64.5},{"___class":“Country”,“Continent”:“Asia”,“MinLifeExpectancy”:45.9},{"___class":“Country”,“Continent”:“Antarctica”,“MinLifeExpectancy”:null},{"___class":“Country”,“Continent”:“Africa”,“MinLifeExpectancy”:37.2},{"___class":“Country”,“Continent”:null,“MinLifeExpectancy”:null}]

Here is for the CountryCount:

[{"___class":“Country”,“Continent”:“South America”,“CountryCount”:14,“objectId”:“ARG”},{"___class":“Country”,“Continent”:“Oceania”,“CountryCount”:28,“objectId”:“ASM”},{"___class":“Country”,“Continent”:“North America”,“CountryCount”:37,“objectId”:“ABW”},{"___class":“Country”,“Continent”:“Europe”,“CountryCount”:46,“objectId”:“ALB”},{"___class":“Country”,“Continent”:“Asia”,“CountryCount”:51,“objectId”:“AFG”},{"___class":“Country”,“Continent”:“Antarctica”,“CountryCount”:5,“objectId”:“ATA”},{"___class":“Country”,“Continent”:“Africa”,“CountryCount”:58,“objectId”:“AGO”},{"___class":“Country”,“Continent”:null,“CountryCount”:8,“objectId”:“061A76E1-EB90-E889-FFE2-D6E44DBF1700”}]

I think it´s correct.

/ Ove

But you made 2 different requests, while it should be single with the following response:

{
    "___class": "Country",
    "Continent": "North America",
    "CountryCount": 37,
    "MinLifeExpectancy": 49.2
  },
  {
    "___class": "Country",
    "Continent": "Asia",
    "CountryCount": 51,
    "MinLifeExpectancy": 45.9
  },
 ...

So that both MinLifeExpectancy and CountryCount were in the response.

Regards,
Stanislaw

OK. Thanks, now it worked. / Ove

1 Like