Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
aguitatierra
Contributor II
Contributor II

Get table's Totals (sum) as a KPI

Hi,

How can I show the Totals (sum) I get on a table as a KPI?

I’m comparing the Gross Number of Hours (Cambio rel. Horas totales brutas) of a year selected (filtrado) with the previous one (filtrado-1). In the examples shown I have selected 2023.

I have the following expressions:

  • Cambio rel. Horas totales netas (filtrado)
    • Sum({$<EstadoGrupo={'Cerrado'}, AñoFin={$(=Max(Year(FechaFin)))}>}HorasTotalesGrupo)
  • Cambio rel. Finalizados participaciones (filtrado)
    • Count({$<EstadoGrupo={'Cerrado'}, Finaliza={'S'}, AñoFin={$(=Max(Year(FechaFin)))}>} AlumnoId)
  • Cambio rel. Horas totales brutas (filtrado)
    • SUM(AGGR([Cambio rel. Horas totales netas (filtrado)]*[Cambio rel. Finalizados participaciones (filtrado)], GrupoId))
  • Cambio rel. Horas totales netas (filtrado-1)
    • Sum({$<EstadoGrupo={'Cerrado'}, AñoFin={$(vAñoAnterior)}>} HorasTotalesGrupo)
  • Cambio rel. Finalizados participaciones (filtrado-1)
    • Count({$<EstadoGrupo={'Cerrado'}, Finaliza={'S'}, AñoFin={$(vAñoAnterior)}>} AlumnoId)
  • Cambio rel. Horas totales brutas (filtrado-1)   EVERYTHING FINE UNTIL HEREj. Now I show what I get with each expression.
    • SUM(AGGR([Cambio rel. Horas totales netas (filtrado-1)]*[Cambio rel. Finalizados participaciones (filtrado-1)], GrupoId))

aguitatierra_3-1696006539086.png

  • SUM(Aggr(Sum({$<EstadoGrupo={'Cerrado'}, AñoFin={$(vAñoAnterior)}>}), GrupoId) HorasTotalesGrupo)

aguitatierra_1-1696006284587.png

  • [Cambio rel. Horas totales netas (filtrado-1)]*[Cambio rel. Finalizados participaciones (filtrado-1)]

With this expression I get the closest to what I want. The table works fine, but in the KPI I can’t manage to get the value that is in Totals.

I also wander it works here…

  • Cambio rel. Horas totales brutas (filtrado)
    • SUM(AGGR([Cambio rel. Horas totales netas (filtrado)]*[Cambio rel. Finalizados participaciones (filtrado)], GrupoId))

… but not now.

aguitatierra_4-1696006586002.png

I’d very much appreciate any help! I’ve been messing around with this quite a bit...

Many thanks in advance!

 

 

Labels (2)
1 Reply
aguitatierra
Contributor II
Contributor II
Author

Something else I've noticed is that if I don't select any year the following expression works

SUM(AGGR([Cambio rel. Horas totales netas (filtrado-1)]*[Cambio rel. Finalizados participaciones (filtrado-1)], GrupoId))

aguitatierra_0-1696007086313.png