About repeating data with filtering, summing, and displaying values

Hello everybody!
First of all I want to thank everyone who asks questions in this forum and especially the AppGyver team who always try to help in the best and most patient way possible
Thank you very much!

I also apologize for having to (for now) use a translator to communicate in English, I’m still lacking in the language.

Well, I’ve been using AG for months and learning more and more, it’s a sensational platform that allows for many excellent opportunities. And I’m not from the programming area and, at most, I write a few lines in JS and my strength is WordPress sites, playing a little with Linux, editing tools, etc.

Well, I’ve already answered many questions and found many solutions here on the forum and as with every new system I’m learning, I make an effort to go as far as I can without asking for extra help, because at least for me, it forces learning. But after hitting my head for more than 40 hours, I give up.

I was able to understand well how APIs, HTTP Requests and most variables work, but I confess that I still get a little caught up with list/object variables for arrays.

I’m creating a system for Brazilian citizens to see where our “beloved” politicians, spend our tax money, in addition to pointing out lawsuits and protests. Believe me, our parliamentarians are drains of draining tax money for their own benefits.

This screen below is one of the initial ones, after choosing a figure to analyze. Still in prototype mode, so don’t consider the layout still horrendous.

Well, I managed to “almost” finish one of the app’s modules, but I got embarrassingly tangled up in something that seems simple, but never brings me the result I need.
After choosing the parliamentarian for analysis, we will click on a button to pull the subject’s “capybara”. For those who don’t know the term, at least here in Brazil, it’s pulling as much public information about a politician as possible. And there’s almost always a lump in the angu! ;O)

Then, we choose the period we want to analyze, where MONTHLY EXPENSES and a sum for the year are shown.

That’s when I started to “take a hit” like Rocky Balboa from Ivan Drago, hehehe
dolph-lundgren-ivan-drago-rocky-4

See on this screen, I can list ALL individual expenses, in each chosen month, so far, so good. But we have a problem: this makes it very difficult for a citizen to have a better view of expenses, so I need to group expenses by groups (here called TYPES OF EXPENSES).

Here, an example of what I need: in the FUEL AND LUBRICANTS expense group, I manage to pull only one title, but the values either come from just one (and there are several) or else, depending on how I stir, repeat and mix all the expenses, of all groups.

Here, the formula that causes only one title to be displayed, instead of repeating all, this formula, OK.


Now here, that’s where I’m trying to find a formula that shows me just one title per type of expense but all the values and then insert a sum.

You can see here that this formula even shows the data I need, but I couldn’t put this data on the screen and add it up later.

In time: I already tested MAP, WITH_ITEM, SELECT, SELECT, SELECT_BY_KEY, SUM, SUM_BY_KEY, and dozens of others. Certainly, some of these might solve my problem, so for now, the problem is that I understand this. I believe that here is necessary some variable for lists or objects, but I couldn’t make it work either.

Then that’s it. It might be something simple for someone more experienced, but at least at this current stage of the journey, I still get hit a lot, and once again, I want to thank everyone who posts something on this forum, it’s enriching and helps a lot.
Thanks!