Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Announcements
Customers, Partners & Luminaries only: You're invited to a Data Analytics Roadmap session. Read More
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

Expresión en Listbox

Buenos dias, quiero meter un expresion en un listbox para que me de el valor segun el resultado de la formula pero no logro hacerlo, me podrian ayudar, adjunto codigo que quiero meter en el objeto para tenerlo como opción.

Saludos,

1 Solution

Accepted Solutions
Highlighted
Creator III
Creator III

Hola,

subo tu código  para resaltarte algo que considero puede ser el error

=if(

          (

                     if(

                               if(

                                         year(today())&'0'&num(Month(today())) = Periodo,

                                         sum({$<Periodo={$(MaxPeriodo)},Id_Division={'SUC'}>} Importe)*DiaMes/DiaAnt,

                                         sum({$<Periodo={$(MaxPeriodo)},Id_Division={'SUC'}>} Importe)

                               ) - sum({$<Periodo={$(MaxPeriodoAñoAnt)},Id_Division={'SUC'}>} Importe) <=0,

                               0,

                               40

                     )

           ) +

          (

                    if(

                              if(

                                        year(today())&'0'&num(Month(today())) = Periodo,

                                        sum({$<Periodo={$(MaxPeriodo)}, Comparativo={'VITAMINAS'}, Id_Division={'SUC'}>} Importe)*DiaMes/DiaAnt,

                                        sum({$<Periodo={$(MaxPeriodo)}, Comparativo={'VITAMINAS'}, Id_Division={'SUC'}>} Importe)

                              ) - sum({$<Periodo={$(MaxPeriodoAñoAnt)}, Comparativo={'VITAMINAS'}, Id_Division={'SUC'}>} Importe)<=0,

                              0,

                              30

                    )

          ) +

          (

                    if(

                              (

                                        if(

                                                  sum({$<Periodo={$(MaxPeriodo)}, Id_Division={'SUC'}>} Importe)>0,

                                                  sum({$<Periodo={$(MaxPeriodo)}, Id_Division={'SUC'}>} Importe),

                                                  ''

                                        ) +

                                        if(

                                                  sum({$<Periodo={$(MaxPeriodo-1)}, Id_Division={'SUC'}>} Importe)>0,

                                                  sum({$<Periodo={$(MaxPeriodo-1)}, Id_Division={'SUC'}>} Importe),

                                                  ''

                                        ) +

                                        if(

                                                  sum({$<Periodo={$(MaxPeriodo-2)}, Id_Division={'SUC'}>} Importe)>0,

                                                  sum({$<Periodo={$(MaxPeriodo-2)}, Id_Division={'SUC'}>} Importe),

                                                  ''

                                        )

                              ) / 3 <=0,

                              0,

                              15

                    )

          ) +

                    (

                              if(

                                        if(

                                                  Ciudad='U. CERRADAS',

                                                  '',

                                                  if(

                                                            year(today())&'0'&num(Month(today())) = Periodo,

                                                            sum({$<Periodo={$(MaxPeriodo)}, Id_Division={'SUC'}>} Importe) * DiaMes / DiaAnt,

                                                            sum({$<Periodo={$(MaxPeriodo)}, Id_Division={'SUC'}>} Importe)

                                                  ) / sum({$<Periodo={$(MaxPeriodoAñoAnt)}, Id_Division={'SUC'}>} Importe) - 1

                                        ) - Crecimiento <=0,

                                        0,

                                        15

                              )

                    )<=50,

                    'Requiere Supervisión',

                    'Alerta')

creeria que esas '' puede ser el error, ya que la suma de '' + '' es nulo, por tanto puede generar errores, te sugiero que lo cambies por un 0.

View solution in original post

2 Replies
Highlighted
Creator III
Creator III

Hola,

subo tu código  para resaltarte algo que considero puede ser el error

=if(

          (

                     if(

                               if(

                                         year(today())&'0'&num(Month(today())) = Periodo,

                                         sum({$<Periodo={$(MaxPeriodo)},Id_Division={'SUC'}>} Importe)*DiaMes/DiaAnt,

                                         sum({$<Periodo={$(MaxPeriodo)},Id_Division={'SUC'}>} Importe)

                               ) - sum({$<Periodo={$(MaxPeriodoAñoAnt)},Id_Division={'SUC'}>} Importe) <=0,

                               0,

                               40

                     )

           ) +

          (

                    if(

                              if(

                                        year(today())&'0'&num(Month(today())) = Periodo,

                                        sum({$<Periodo={$(MaxPeriodo)}, Comparativo={'VITAMINAS'}, Id_Division={'SUC'}>} Importe)*DiaMes/DiaAnt,

                                        sum({$<Periodo={$(MaxPeriodo)}, Comparativo={'VITAMINAS'}, Id_Division={'SUC'}>} Importe)

                              ) - sum({$<Periodo={$(MaxPeriodoAñoAnt)}, Comparativo={'VITAMINAS'}, Id_Division={'SUC'}>} Importe)<=0,

                              0,

                              30

                    )

          ) +

          (

                    if(

                              (

                                        if(

                                                  sum({$<Periodo={$(MaxPeriodo)}, Id_Division={'SUC'}>} Importe)>0,

                                                  sum({$<Periodo={$(MaxPeriodo)}, Id_Division={'SUC'}>} Importe),

                                                  ''

                                        ) +

                                        if(

                                                  sum({$<Periodo={$(MaxPeriodo-1)}, Id_Division={'SUC'}>} Importe)>0,

                                                  sum({$<Periodo={$(MaxPeriodo-1)}, Id_Division={'SUC'}>} Importe),

                                                  ''

                                        ) +

                                        if(

                                                  sum({$<Periodo={$(MaxPeriodo-2)}, Id_Division={'SUC'}>} Importe)>0,

                                                  sum({$<Periodo={$(MaxPeriodo-2)}, Id_Division={'SUC'}>} Importe),

                                                  ''

                                        )

                              ) / 3 <=0,

                              0,

                              15

                    )

          ) +

                    (

                              if(

                                        if(

                                                  Ciudad='U. CERRADAS',

                                                  '',

                                                  if(

                                                            year(today())&'0'&num(Month(today())) = Periodo,

                                                            sum({$<Periodo={$(MaxPeriodo)}, Id_Division={'SUC'}>} Importe) * DiaMes / DiaAnt,

                                                            sum({$<Periodo={$(MaxPeriodo)}, Id_Division={'SUC'}>} Importe)

                                                  ) / sum({$<Periodo={$(MaxPeriodoAñoAnt)}, Id_Division={'SUC'}>} Importe) - 1

                                        ) - Crecimiento <=0,

                                        0,

                                        15

                              )

                    )<=50,

                    'Requiere Supervisión',

                    'Alerta')

creeria que esas '' puede ser el error, ya que la suma de '' + '' es nulo, por tanto puede generar errores, te sugiero que lo cambies por un 0.

View solution in original post

Highlighted
Not applicable

Perfecto, eso era mi error, muchisimas gracias.