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: 
Presto
Contributor
Contributor

Pivot shows right information, pivot sum is not right, selections destroys it...

Hi,

i want to analyze som economical data for some companies and my data is structured like:

CompanyParameterPeriodData
Company ARevenue20183000
Company ARevenue20172850
Company ARevenue20162700
Company AProfit2018300
Company AProfit2017200
Company AProfit2016100
Company BRevenue20178000
Company BRevenue20166000
Company BProfit20171000
Company BProfit2016800
Company CRevenue20185000
Company CRevenue20176000
Company CRevenue20165500
Company CProfit2018250
Company CProfit2017120
Company CProfit2016200


I have about 20-30 companies that i want to analyze, not just three. I want to see sum revenue, for the selection of comapnies,  for example 2018 compared to 2017. In this case Company B doesnt have any value registred for 2018 and in such case i would like to reuse the value for 2017.

A Pivot would look like this:

 RevenueRevenueRevenue  
 Last20182017 
Company A300030002850
Company B800006000
Comapny C500050006000
Sum of total16000800014850

 

I tried to make a measure "Last":
If (
(Sum({$<Parameter={"Revenue"},Period={"2018"}>}Data) > 0 )
, (Sum({$<Parameter={"Revenue"},Period={"2018"}>}Data))
, (Sum({$<Parameter={"Revenue"},Period={"2017"}>}Data))
)

When i use the above on a Pivot table everything looks fine except the summary wich is wrong in column "Last" (it show the same value as in colum "2018" (8000).

If i make a KPI it only gets right when i select companies who all have values for "2018" or select all who doesnt have values for "2018".

I understand that my problem depends om my first If-line but i dont know how to solve it so every help would be valuable!

 

 

0 Replies