Sum function -codeless

Hi,
I would like to get total sales by summing up all values in table(orders) - column amount where status equals to complete.

I cant figure this out using codeless blocks.
Regards stanoss

Hi,

Before you get to doing it in codeless, it is recommended to work it out and test the query in Backendless REST Console. Have you tried it yet? It is available on the DATA screen of Backendless Console. Once a query is configured, it is rather straightforward to map the query parameters to the codeless block.

Regards,
Mark

Hello @mark-piller
I have tried it in REST CONSOLE and its working fine.
I just dont have any idea how to (map) arrange the blocks and get an output of total sales.


Regards
Stanoss

That’s a good start. What does the Request URL for the query show in REST Console?

Thats what it shows :

/data/fuel_orders?where=status%3D’completed’&property=Sum(%60amount%60)%20as%20sales

@mark-piller

Now that you have a request URL, it is broken down like this:

/data/fuel_orders                                    <<< table name
            ?where=status%3D’completed’&             <<< where clause
            property=Sum(%60amount%60)%20as%20sales  <<< properties

I have tried your way @mark-piller
And i get the following error on chrome inspect :


And this is what i have in my logic :

What could possibly be the issue with my logic.
Regards
Stanoss

Just fix the where clause, it is url encoded and instead use this:

status = 'completed'

It still says invalid :

You are using wrong single quotes. Try going back to REST console to test your query and then copy from there