Qlik Community

Ask a Question

New to QlikView

If you’re new to QlikView, start with this Discussion Board and get up-to-speed quickly.

Welcome to our newly redesigned Qlik Community! Read our blog to learn about all the new updates: READ BLOG and REPORTED ISSUES
Showing results for 
Search instead for 
Did you mean: 
Specialist III
Specialist III

Wrong Pivot Table Values

Hi community,

I have a new problem in my dashboard, when I enable the "Show Partial Sums" in the Presentation Tab in my Chart Properties, I get a wrong value. In the snapshot bellow you can see it clearly that there is something wrong with the value:

Sem Título1.png

My dimensions are:

  • [Zona]
  • [CodLocal] labeled as [Cod. Local]
  • [CodEmpregado] labeled as [Cod. Funcionário]

My expressions are:

  • =sum(CustoReal) -> labeled as [€ Custo Real]
  • =sum(CustoReal)*num(sum({$<Zona=, CodLocal=, CodEmpregado=, data= >} DISTINCT Imputacao%)) -> labeled as [Imputação]

The [Imputacao%] values table:

Sem Título2.png

What is the changes that I need to make to get the correct output result (1 316,41 €) for the totals of [Imputação] and (3 949,22 €)?

Can you experts help me? hicgwassenaarsunindiajontydkpi‌ can you help me? Anyone?

If anyone needs further more explanation, please ask it in the comment section bellow.



1 Solution

Accepted Solutions
Specialist III
Specialist III

This was the solution that I could by myself get:

Sem Título3.png

With the expressions be like:

  • %Imputação -> =Sum(Imputacao%)
  • € Imputação -> =Sum(Aggr(((tempo*1440)/60)*(ValorHora)*(Imputacao%), Zona, CodLocal, [CodEmpregado], [DataHora], [Saída]))
  • € Custo Real -> =Sum(Aggr(((tempo*1440)/60)*(ValorHora), Zona, CodLocal, [CodEmpregado], [DataHora], [Saída]))

Hope someone find a similar problem in the future and that this answers may give you a similar solution. Have fun and good job people

View solution in original post

10 Replies

Most likely you will need to use Dimensionality() function to use different expressions for your Partial Sum Rows. Do you have a qvw sample we can look at?

Specialist III
Specialist III

I'm afraid I can't have the permission to share a qvw sample, due to privacy policy from my client . How can I use the Dimensionally() here?

I wouldn't use dimensionality unless I wanted a different calculation on the totals - i.e. different from what I have on the rows. In your case, You want Sum(CustoReal) everywhere right?

No, if the subtotals are wrong, I'd say your data model is wrong. QlikView calculates correctly. It could e.g. be that the same dollar is asigned to several "Cod.Local" or to several "Zona". Then you would get exactly what you have here: A total that indeed is summed correctly in the fact table, but does not correspond to the sum of the lines in the pivot table.

My guess is that the "Zona" isn't connected to the data at all: Note that CBRASS is 398.50 no matter which "Zona" you look at.


PS If you create a text box with =Sum(CustoReal) in it, what do you get? This number is the true number in your data model.

Specialist III
Specialist III

Hi sunindia,

Recently I've had the permission to develop a sample qvw so that I can share with my problem in it



Not applicable

The problem is the table Zona, probability you joined Zona with Local and duplicated..

Specialist III
Specialist III

If you see the Data Model, there is no duplication of Zona. Thanks for answering for my question

Not applicable

so, maybe the table Zona isn't relationship with Fact..

Specialist III
Specialist III

Hi Marcos, my field Zone is linked with a table called PresenteFuturo and that's our fact table.

Specialist III
Specialist III

Hi hic‌ have you view my qvw sample?