Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for
Did you mean:
Contributor III

## Pivot table cumulative sum initial and current balance

Goodmorning everyone,

I have the following current situation (see image) where the initial balance "(1) Saldo iniziale" is calculated from the following formula that calculates the balance preceding the date of the calendar object (4):

``````(RangeSum(Above(TOTAL SUM({<[Master Calendar Date Calc]={"<\$(=\$(vInizioPC))"}, Anno=,Mese=,Giorno=>}[# Importo Fattura Iva]),0,RowNo(TOTAL)))
-
RangeSum(Above(TOTAL SUM({<[Master Calendar Date Calc]={"<\$(=\$(vInizioPC))"}, Anno=,Mese=,Giorno=>}[# Importo Pagato Scadenze Pagamenti]),0,RowNo(TOTAL))))``````

while the current balance that takes into account the date range selected by the calendar object is calculated (4😞

``````(RangeSum(Above(TOTAL SUM({<[Master Calendar Date Calc]={">=\$(=\$(vInizioPC))<=\$(=\$(vFinePC))"}, Anno=,Mese=,Giorno=>}[# Importo Fattura Iva]),0,RowNo(TOTAL)))
-
RangeSum(Above(TOTAL SUM({<[Master Calendar Date Calc]={">=\$(=\$(vInizioPC))<=\$(=\$(vFinePC))"}, Anno=,Mese=,Giorno=>}[# Importo Pagato Scadenze Pagamenti]),0,RowNo(TOTAL))))``````

I made a pivot table (3) with 5 dimensions and 3 expressions; the expressions are:

``````1)"DARE"
SUM({<[Master Calendar Date Calc]={">=\$(=\$(vInizioPC))<=\$(=\$(vFinePC))"}, Anno=,Mese=,Giorno=>}[# Importo Fattura Iva])
2) "AVERE"
SUM({<[Master Calendar Date Calc]={">=\$(=\$(vInizioPC))<=\$(=\$(vFinePC))"}, Anno=,Mese=,Giorno=>}[# Importo Pagato Scadenze Pagamenti])
3) "SALDO"
(RangeSum(Above(TOTAL SUM({<[Master Calendar Date Calc]={">=\$(=\$(vInizioPC))<=\$(=\$(vFinePC))"}, Anno=,Mese=,Giorno=>}[# Importo Fattura Iva]),0,RowNo(TOTAL)))
-
RangeSum(Above(TOTAL SUM({<[Master Calendar Date Calc]={">=\$(=\$(vInizioPC))<=\$(=\$(vFinePC))"}, Anno=,Mese=,Giorno=>}[# Importo Pagato Scadenze Pagamenti]),0,RowNo(TOTAL))))``````

How can I start the cumulative sum of the "SALDO" by adding to each line of the pivot table the initial balance "Saldo Iniziale"?

thanks

Labels (4)

• ### Set Analysis

11 Replies
MVP

Check attached

Contributor III
Author

Very well,

thanks

Community Browser