I need help with queries

As a person who tries to figure out how query works. I have understanding of SQL but not of javascript so please bear.
I need help with following: ( I have data connected with google sheet-resource data)

  1. I want to show sum of a perticular column (i.e expense amount) within a stats widget. What would be the query?
  2. My table contains customer, subscribers.
  • query for counting only customer in that table. (column name: Status)
  1. I have two table, One that contains customer name and other that contains invoice amount for him.
    how to connect these two columns.

when we select that customer, how does I show key value (invoice amount affiliated with him)

Thank you

Hey @Zaki!

1. Would something like {{ _.sum(yourQuery.data.yourExpenseColumn) }} work for the sum? This code snippet uses Lodash’s sum function which accepts an array and sums it up. Lodash is a cool library that comes built into Retool. It has a bunch of helpful functions and their docs are pretty clear :slightly_smiling_face: https://lodash.com/docs/

2. This is definitely doable, I just might need a bit more context. Any screenshots you have of your data would be great. Just in case, would this special query type be helpful at all? https://docs.retool.com/docs/querying-via-sql

I know you mentioned you’re more proficient in SQL, so this might be more up your alley!

Thank you. you are amazing. I'll check lodash. I'm working with someone who can help me out with this using the docs.

Awesome, glad it hear it! Definitely let us know if we can help with anything else :hugs: