Sum totals of transaction categories

Hello world,

I’ve converted my hours of invoicing (mostly formatting) into a pdf using Appsheet.

My two first rows are working great for sending invoices and estimates but I would love to have a summary at the bottom of those rows summing up the categories included for yearly reports. I’ll attach two screenshots, one of my expressions in the pdf template and the other of what I was able to print. The issue is I don’t know how to group them by category and sum that categories total to the right.

Any help or guidance would be much appreciated! Thanks in advance.


0 11 496
11 REPLIES 11

I can’t understand what you asking for. A mock-up of the desired output would clear things up immensely.

Thanks for the quick reply Marc, attaching a mock-up. I don’t think it’s a very complex task I’m just having no luck with the ways I’ve tried to group and total them so far.

If there are only the two possible categories shown, replace this:

with this;

Rent Payment <<SUM(SELECT([Related PAYMENTS][AMOUNT], ("Rent payment" = [CATEGORY])))>>
Management <<SUM(SELECT([Related PAYMENTS][AMOUNT], ("Management" = [CATEGORY])))>>

 

I'm going through the same problem. What solution did you use to list the categories dynamically?

Thanks @Steve, with some alteration due to my column types I was able to make this work.
There are many possible categories so until I figure out how to only summarize the selected categories I’ve written individual expressions for each possible category.

I’ve tried different versions of the SUM expression to omit unnecessary totals but nothing seems to work. In the screenshot attached, the “Other” category at the bottom isn’t included so it’s total ($0.00) shouldn’t appear either. Any suggestions on how to not include the totals that aren’t applicable?

Expression to show a specific category:

<<SELECT([Related PAYMENTS][CATEGORY],IN([CATEGORY] , LIST( "MANAGEMENT" )),TRUE)>>

Expression to sum that specified category:

<<SUM(SELECT([Related PAYMENTS][TOTAL],IN([CATEGORY] , LIST( "MANAGEMENT" ))))>>

Thanks @Marc_Dillon this was really helpful for a handful of other reasons as well like formatting. Not sure why I didn’t come across this page during my search.

The If expressions worked for hiding it but it still exists and creates a blank row for them. Is it possible to not include them at all and keep a cleaner format?

What’s the template look like right there?

It’s probably way more convoluted than it should be but since I’m pulling rows from a virtual column called ‘Related Payments’ I wasn’t able to use a normal Select function. It’s very likely I’m wrong and missing something simple.

This is what you’re doing, simplified, with table borders visible:

This is what you need to be doing in order to prevent the blank row:

Hey Marc, for some reason the monitor was telling me there was an unmatched <<ENDIF>> when an <<IF: immediately followed it on the same line but not when you indented down like 2-3 lines. I fought with this for hours until finally scrapping it and rewriting it all with just two columns per row and formatted to the left of the page. Works perfectly but isn't as dynamic as I'd like it to be.

Is it possible to run something like this but omit the duplicate categories and sum the total of that category in that row making it more universal and saving me the hassle of adding new <<IF: ... <<ENDIF>> lines for new categories. When I try to change this ORDERBY to a SELECT it doesn't seem to work with a virtual column.

Screen Shot 2022-01-25 at 4.26.25 PM.pngScreen Shot 2022-01-25 at 4.13.48 PM.png

Top Labels in this Space