Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
DanCasSan
Contributor III
Contributor III

Segmented Average

Dear, good day.

Please, your support to be able to correctly formulate what is shown in the graph, the data in the table corresponds to the information of a venue:

DanCasSan_0-1654709930322.png

 

I have a pivot table and I want to show the average based on the month and year for each location, however, another data is being returned.

This is the formula I am using:

=If(GetSelectedCount([Tiempo.Año])=0 or GetFieldSelections([Tiempo.Año])=Year(Now()),
Avg({<[Tiempo.Año]={">=$(vAño10)<=$(vAñoAnterior)"},[Tiempo.Mes numérico]={"$(vMesActualNumerico)"}>} [Precipitación]),
If(GetFieldSelections([Tiempo.Año])<>Year(Now()) and GetSelectedCount([Tiempo.Año])=1,
Avg({<[Tiempo.Año]={">=$(vMaxAño10)<=$(vMaxAñoAnterior)"},[Tiempo.Mes numérico]={"$(vMaxMes)"}>} [Precipitación])))

I appreciate the support!

Cheers,
DC

Labels (3)
0 Replies