Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Faris
Contributor
Contributor

Sum Rows in PnL table

Hello,

My problem is  quite intricate because of the many measures and variables I'm using but I will try my best at explaining it and I hope someone can help me. 

I have a PnL table that consists of predefined measure * variables so that users can do scenario-based analysis. This table consists of one dimension row where there is only one dimension. So called "PnL Heading".

I only have one measure as well but it is quite long and complex. I have not been successful in splitting it up because then I get a bunch of 0 values under my columns. My columns are quarters. See pictures.

I want to add sums of the two first rows and the two last but I can't figure out how. It would be easer if I had the measure split up by different quarters or dimensions but when I try this, I get multiple columns per quarter instead of one.

It is very hard to explain it but please ask me if I can clarify anything and I will respond within minutes.

Labels (1)
3 Replies
arh5451
Partner - Contributor
Partner - Contributor

I think you need to revisit your data model. It seems like the issue is in the data model and not your expressions.

With a simpler data model you will likely have an easier time.

Faris
Contributor
Contributor
Author

How did you come to that conclusion with so little information @arh5451? I am aware that the data model can be optimized. This is something I have informed the developers that have created the application.

Unfortunately that is not a option for me because of the timeframe so I'm hoping someone can help me with this as soon as possible.

All I really want to do is add sums for the two first rows and the two last rows. Even if it's one long measure I'm sure it has to be possible?

arh5451
Partner - Contributor
Partner - Contributor

Hi Faris,

What your trying to develop is a P&L. Achieving a P&L in Qlik is do-able, but can be challenging. You can't simply add the two rows in Qlik. Qlik aggregates across the dimension so it will naturally want to add all rows related to the dimension.

Reason I know the data model is not optimal.

1.) Your expression calculation in picture one is far too complicated for such a simple calculation.

I would recommend reading how to make a P&L in Qlik and recreating the data model. Then you won't have any issues.

https://help.qlik.com/en-US/sense/May2022/Subsystems/Hub/Content/Sense_Hub/Visualizations/Visualizat...

https://community.qlik.com/t5/QlikView-Documents/How-to-Create-a-Profit-and-Loss-Statement-in-QlikVi...