Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Cecika
Partner - Contributor
Partner - Contributor

how to preserve the accumulated values ​​in other periods when they are zeroes "0"

Hello!

I need to accumulate by period and when it is "0" to keep the accumulated value of the previous period
for example the letter F that has ID in January, but in February it has no data,
So in February you must show what comes from January, in March and April there is no data
therefore, March and April must show the accumulated of January, February, March and April with value 1,
and that if it brings data it should show value 2 (example in June) and so on with the rest of the letters.

I attached an output (Image) with the Letter F (Output)

Thanks !

Output Acummulated (Example Letter F) (2).png

Labels (2)
2 Replies
brunobertels
Master
Master

Hi 

May be this :

Count({<[Año_Creacion_SS]={'$(vAñoMax)'},
[Field 2]={'Value 1'},[Field 1]-={'-'}>}
Distinct ID&[Field 1])+sum({1}0) )

 

Or have a look to post regarding asOfTable in the meaning to create missing date : 

https://community.qlik.com/t5/App-Development/How-to-calculate-months-with-missing-records/td-p/2178... 

 

Regards, 

 

Cecika
Partner - Contributor
Partner - Contributor
Author

Hello!
Thank you for your answer, but the letter F still does not appear in the periods of February, March, April and May, where I have no data there. (Image attached)

Cecika_2-1622814957687.png

 

As it is about accumulated, if for the following month
it does not come with data, it should show me what comes from the previous month
for example if in January I have a value of 2, in February a 3,
February should show me 5 right? Now, if in March I have no data,
March should show me 5 (0 + the accumulated of the two previous months). If April has a value of 1
April should show me 6 and so on for the other months of the year.

Thanks !