Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
rosemary
Contributor
Contributor

If value is zero, show previous non-zero value

Hi Experts,

I have below data set:

CountryMonthNew ContactsTotal Contacts
Hong Kong2020-0100
Hong Kong2020-0233
Hong Kong2020-0358
Hong Kong2020-041018
Hong Kong2020-05422
Hong Kong2020-06224
Hong Kong2020-071438
Hong Kong2020-081048
Hong Kong2020-09654
Hong Kong2020-101468
Hong Kong2020-111886
Hong Kong2020-121298
Hong Kong2021-0100

 

Las column is showing a cumulative values. The thing is I need to have for the last Column - Total Contacts, last max value - which in this example is 98. So it should look like below: 

CountryMonthNew ContactsTotal Contacts
Hong Kong2020-0100
Hong Kong2020-0233
Hong Kong2020-0358
Hong Kong2020-041018
Hong Kong2020-05422
Hong Kong2020-06224
Hong Kong2020-071438
Hong Kong2020-081048
Hong Kong2020-09654
Hong Kong2020-101468
Hong Kong2020-111886
Hong Kong2020-121298
Hong Kong2021-01098

 

Can you help me with that?

Rosemary

Labels (1)
2 Replies
GaryGiles
Specialist
Specialist

To achieve the resulting table, you could have Country and Month as Dimensions.  Add [New Contacts] as a measure twice with no aggregation function.   In the properties panel of the second measure, use a Modifier of Accumulation.  The Modifier option is just below the Measure Expression definition.  Set the Accumulation Dimension to Month and Range to Full.  The limitation is that you can only have up to 2 dimensions in the table.

GaryGiles_0-1610799165682.png

 

Ksrinivasan
Specialist
Specialist

hi,

find your chart expression is 

rangesum(above(Sum([New Contacts]),0,RowNo()))

 

Ksrinivasan_0-1610810980974.png

Ksrinivasan