Sum Based on Choice
Trying to add up all totals from multiple records based on a choice. Data Base is called Receipt Details. When I choose a month, for example OCT under Statement Month, I want all records with OCT to be totalled under Statement Total. If I choose a different month, the Statement Total should show that month's Total.
I've looked at the forum and couldn't figure it out. Help appreciated! Thank you in advance.
5 replies
-
just to confirm:
1) Statement Month is a simple choice field or a dynamic choice field.
2) What is the table name of the screenshot? What is the table name that you want to get the totals from?
3) What is the field name in the table that has the month data? What kind of field is it?
If you can, upload a sample of your DB with sample data.
-
said:
1) Statement Month is a simple choice field that I choose
2) Table name is "Receipt Details" 2) Table name that I want to get the totals from is "Receipt Details", but from the "Total" seen in the screenshot
3) Field name is "Statement Month" 3) Field is a Choice Field
Not sure if that matters, but the Total is already calculated from a simple formula not shown: ('Sub-Total' + HST)Ok so you can try something like:
let t := this; sum((select 'Receipt Details' where text('Statement Month') = text(t.'Statement Month')).Total)
If you 'Statement Month' choices have the same choice number then you can remove the text() part.
Content aside
- Status Answered
- 1 yr agoLast active
- 5Replies
- 81Views
-
2
Following