Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

If clausule mixed with set analisys problem

Good morning ladies and gentlemen of the QV Community

I have the following problem , I have a pivot table ( see attached image ) , which have a dimension cyclic group with three fields (Region , Sucurzal and Linea ) additionally have a dimension of a field ( _Etiqueta ) which is part an island with three registers ( Ventas, Presupuesto and Diferencia ) , this in order to achieve what you see in the image columns take the titles of expressions (  Ventas, Presupuesto and Diferencia) and columns table instance time expression:

  • Cierre día 09/04/2014 --> Value of Ventas, Presupuesto and Diferencia in Yesterday() ,
  • Act MTD 04/14 --> Acumulated Value to Yesterday of Ventas, Presupuesto and Diferencia in Month of Yesterday
  • Act MTD Año Anterior 04/13 --> Acumulated Value to Yesterday in last year of Ventas, Presupuesto and Diferencia in Month of Yesterday of last year
  • Var ACT MTD Año Anterior --> Variation of Act MTD 04/14 and Act MTD Año Anterior 04/13
  • YTD 14 --> YTD in Actual Year
  • YTD 13 --> YTD in Last Year
  • Var ACT YTD Año Anterior --> Variation of YTD 14 and YTD 13

Under this scenario , I have the problem that are highlighted in yellow (See the image), which shows that in 2014 month April , there is no Ventas and Presupuesto for M & MS "Linea" , for this reason not present information in the "Cierre día 09/04/2014" and "Act MTD 04/14" columns but must submit information in Act MTD Año Anterior 04/13

Captura.PNG.png

To accomplish this, the expresion is formed in the following manner

If(_Etiqueta = ‘Ventas’ , Sum ( { “Set Analisys para encontrar el año anterior”}  VentasDS)

,If(_Etiqueta = ‘Presupuesto’, Sum ( { “Set Analisys para encontrar el año anterior”}  Presupuesto)

,

(

Sum ( { “Set Analisys para encontrar el año anterior”}  VentasDS)

/

Sum ( { “Set Analisys para encontrar el año anterior”}  Presupuesto)

)-1

)

See the original Formula

If(_Etiqueta ='Ventas',

Money(

Sum({<Año_Calendario = {$(=if(GetSelectedCount(Año_Calendario) + GetSelectedCount(Mes_Calendario) + GetSelectedCount(Dia_Calendario) + GetSelectedCount(PeriodoJJ) =0, Year(Today()), Max(Año_Calendario)))}

      >} ValorDS

    )/1000000

       ),

If(_Etiqueta ='Presupuesto', 

   Money(

Sum({<Año_Calendario = {$(=if(GetSelectedCount(Año_Calendario) + GetSelectedCount(Mes_Calendario) + GetSelectedCount(Dia_Calendario) + GetSelectedCount(PeriodoJJ) =0, Year(Today())-1, Max(Año_Calendario)-1))}

      >} presupuesto_General

    )/1000000

       ),

     Num(

  (

  Sum({<Año_Calendario = {$(=if(GetSelectedCount(Año_Calendario) + GetSelectedCount(Mes_Calendario) + GetSelectedCount(Dia_Calendario) + GetSelectedCount(PeriodoJJ) =0, Year(Today())-1, Max(Año_Calendario)-1))}

      >} ValorDS

    )

    /

Sum({<Año_Calendario = {$(=if(GetSelectedCount(Año_Calendario) + GetSelectedCount(Mes_Calendario) + GetSelectedCount(Dia_Calendario) + GetSelectedCount(PeriodoJJ) =0, Year(Today())-1, Max(Año_Calendario)-1))}

      >} presupuesto_General

    )

  )-1 

       ,'#.##0,00%')

    )

    )     

  )

1 Solution

Accepted Solutions
Not applicable
Author

I solved the problem, with assitance of Miguel Angel Garcia from QlikFix, i change the IF Statement

  • Last version: "If(_Etiqueta = ,"
  • New Version:  "if(MaxString(Total <_Etiqueta> _Etiqueta) ="


View solution in original post

1 Reply
Not applicable
Author

I solved the problem, with assitance of Miguel Angel Garcia from QlikFix, i change the IF Statement

  • Last version: "If(_Etiqueta = ,"
  • New Version:  "if(MaxString(Total <_Etiqueta> _Etiqueta) ="