Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Not showing all the column totals, any idea why?

Hi all I have a tabel called "Gastos" I don´t know why its showing just a few column totals, does any body know why is this??

I attached the app.

Thank you all!!

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Yes, the total is calculated as expression total. Since you are using an if() clause in your expression that is depending on your dimension value, there is no unambiguous result for the total for the columns with an expression value for more than one dimension value.

In a pivot, you can't use the total mode sum of rows, but you can use advanced aggregation to get the same result.

Try this as expression in your pivot table:

=

sum( aggr(

IF(ACCOUNT_NAME = 'ABRASIVOS Y HERRAMIENTAS', SUM(Gastos),

    IF(ACCOUNT_NAME = 'DADOS, MONTADURAS Y DISPOSITIVOS', SUM(Gastos),

      IF(ACCOUNT_NAME = 'NOMINA Y PRESTACIONES', SUM(Gastos),

         IF(ACCOUNT_NAME = 'GASTOS DE PRUEBA Y DESARROLLO', SUM(Gastos),

            IF(ACCOUNT_NAME = 'SERVICIOS TI', SUM(Gastos),

              IF(ACCOUNT_NAME = 'NOMINA_HRAS', sum({$<ACCOUNT_NAME = {'MINA_HRAS'}>}[Costo por hora]* [Hrs Reales]),))))))

,ACCOUNT_NAME,COCE_NAME))

+

sum({$<ACCOUNT_NAME = {"NOMINA_HRAS"}>}[Costo por hora]* [Hrs Reales])

Hope this helps,

Stefan

View solution in original post

2 Replies
swuehl
MVP
MVP

Yes, the total is calculated as expression total. Since you are using an if() clause in your expression that is depending on your dimension value, there is no unambiguous result for the total for the columns with an expression value for more than one dimension value.

In a pivot, you can't use the total mode sum of rows, but you can use advanced aggregation to get the same result.

Try this as expression in your pivot table:

=

sum( aggr(

IF(ACCOUNT_NAME = 'ABRASIVOS Y HERRAMIENTAS', SUM(Gastos),

    IF(ACCOUNT_NAME = 'DADOS, MONTADURAS Y DISPOSITIVOS', SUM(Gastos),

      IF(ACCOUNT_NAME = 'NOMINA Y PRESTACIONES', SUM(Gastos),

         IF(ACCOUNT_NAME = 'GASTOS DE PRUEBA Y DESARROLLO', SUM(Gastos),

            IF(ACCOUNT_NAME = 'SERVICIOS TI', SUM(Gastos),

              IF(ACCOUNT_NAME = 'NOMINA_HRAS', sum({$<ACCOUNT_NAME = {'MINA_HRAS'}>}[Costo por hora]* [Hrs Reales]),))))))

,ACCOUNT_NAME,COCE_NAME))

+

sum({$<ACCOUNT_NAME = {"NOMINA_HRAS"}>}[Costo por hora]* [Hrs Reales])

Hope this helps,

Stefan

Not applicable
Author

Yes, I din´t know that, thank you stefan, it works!!