Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
brunolelli87
Creator II
Creator II

Sum by quarter

Hello guys,

I have an excel spreadsheet with the following format:

TickerPeriodoAtivo TotalAtivo CirculanteDisponibilidades
ITUB431/12/2019182347169,826470174,72

11905

ITUB430/09/2019171856281,621212354,5651645
ITUB430/06/2019175201058,816937673,7318392
ITUB431/03/2019180858191,920059187,258415
ITUB431/12/2018198186549,218694776,833385456,896
ITUB430/09/2018196365320,212278881,28665008
ITUB430/06/2018192919715,812151491,58636017,984
 ITUB431/03/2018185301794,816104360,96597940,992
 ITUB431/12/2017192388071,428621142,02625811,008
BBDC431/12/2019182347169,826470174,7211905
BBDC430/09/2019171856281,621212354,5651645
BBDC430/06/2019175201058,816937673,7318392
BBDC431/03/2019180858191,920059187,258415
BBDC431/12/2018198186549,218694776,833385456,896
BBDC430/09/2018196365320,212278881,28665008
BBDC430/06/2018192919715,812151491,58636017,984
BBDC431/03/2018185301794,816104360,96597940,992
BBDC431/12/2017192388071,428621142,02625811,008

 

How can I SUM, the values of the column DISPONIBILIDADES of the selected Ticker (ITUB4 for example), that belongs to:

1. The Last available year? (In this case the system should check for all available data for the last year, on column Periodo)
2. The Last available quarter? (In this case, the system should check the most current Periodo available)

 

How can I do that?

 

Thanks

14 Replies
brunolelli87
Creator II
Creator II
Author

Thanks for your help and patience!

It's a very nice approach... but it's not working perfectly.
As you can see on the picture below, the system is considering the Lucro from 31/12/2019 on the previous dates, (21/12, 22/12, 13/12... up to 31/12). And from 02/01/2020 up to 21/01/2020 there is n value.

I'm expecting to get the values as I draw using the red lines and the blue lines.

For example:
The value of Lucro per Quarter on 24/12/2019 shouw not come from the Lucro of 31/12/2019, but from the lucro from the month 9.... And the Lucro per Quarter on 14/01/2020 that is a blank value now, should be 2.802.388, obtained from the Lucro of 31/12/2019.

Result.png

 

How can I solve it?
Thanks

Bruno Lelli

Vegar
MVP
MVP

If you add a day to the date of the lurco transaction then it will fall into t he correct Quarter. 

brunolelli87
Creator II
Creator II
Author

Good!

How could I now sum the value of [Lucro] of the last 4 quarters, and show it in the same way we were dowing with the new column you teached me?

Vegar
MVP
MVP

I'm not sure if I completely understand your question.

Doesn't the Lucro expression in my application meet your need? What if you put an outer sum() around it like this?

=sum(aggr(nodistinct sum(Lurco), Quarter))

brunolelli87
Creator II
Creator II
Author

Hello Vegar, 

Thanks for all your assistance...

 

You solve my problem... your approach was amazying, and your solution was easier and faster than I was expecting.
Thank you so much!

 

Bye