Code Monkey home page Code Monkey logo

Comments (3)

mellophone avatar mellophone commented on August 16, 2024

So I first added a few entries to the member_point_transaction table as a quick test, and then I changed the member view code to left join with the member_point_transaction table based on contact_id. In order to use aggregate functions, I added the group by line so that the points will group based on the contact_id. Finally I just added the points field to the view and set it to the sum of each contact's points found in the member_point_transaction table. I used the coalesce() function so that instead of anyone's points being [NULL], it will just return as 0 instead.

Old member view code:
Image

New member view code:
Image

Example member_point_transaction rows:
Image

Member view results:
Image

from astro-api.

mellophone avatar mellophone commented on August 16, 2024

Link to new Member View SQL:
https://drive.google.com/file/d/1pf4djsVKuXFXJ3GtSSFIMTPffQjwoNh_/view?usp=sharing

Link to new Active Member View SQL:
https://drive.google.com/file/d/1uBYXd0tHgW87hyyV5rhb60kcTUJ-FAAr/view?usp=sharing

from astro-api.

crudemandarin avatar crudemandarin commented on August 16, 2024

Changes to the SQL code have been uploaded to our Google Drive. Great work Ben!

from astro-api.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.