3 Replies Latest reply: Apr 25, 2017 5:26 PM by Rob Wunderlich

# Get the same total for the row.

I was wondering me if is there any chance to get the total value to a row, like TOTAL function, I am looking for a way to get the total of a expression for all the dimenesions that below to the expression.

I mean, according with the following image, I want the value 496 for the records of "Almacenaje Y Transporte" and the same for the others values.

I hope someone can help me this topic,

Best regards.

• ###### Re: Get the same total for the row.

You can use the TOTAL keyword with <>  qualifiers. For example:

sum(Total<[Area Funcional]> somefield)

So for example, to find the percentage of each row within [Area Funcional]:

sum(somefield) / sum(Total<[Area Funcional]> somefield)

-Rob

http://qlikviewcookbook.com

• ###### Re: Get the same total for the row.

Hi, I should posted this before, my current expression:

If I get your idea the expression become in sometime like this:

[Cantidad] / ((Count(TOTAL<[Area Funcional]> {<ANO={\$(vAno_anterior)}, NOM_MES={\$(vNomMes_anterior)}, NOMBRE_MOTIVO_RETIRO=,MOTIVO_RETIRO=>} DISTINCT CEDULA_EMPLEADO) + Count(TOTAL<[Area Funcional]>{<ANO={\$(vAno)}, NOM_MES={\$(vNomMes)}, NOMBRE_MOTIVO_RETIRO=,MOTIVO_RETIRO=>} DISTINCT CEDULA_EMPLEADO)) / 2)

The original expression used TOTAL without any qualifier and this got the overall total of the areas but not the total per area.

• ###### Re: Get the same total for the row.

I believe you have it correct except the TOTAL should come after the set expression:

[Cantidad] / ((Count( {<ANO={\$(vAno_anterior)}, NOM_MES={\$(vNomMes_anterior)}, NOMBRE_MOTIVO_RETIRO=,MOTIVO_RETIRO=>} DISTINCT CEDULA_EMPLEADO) + Count(TOTAL<[Area Funcional]>{<ANO={\$(vAno)}, NOM_MES={\$(vNomMes)}, NOMBRE_MOTIVO_RETIRO=,MOTIVO_RETIRO=>} TOTAL<[Area Funcional]> DISTINCT CEDULA_EMPLEADO)) / 2)

-Rob