Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Anonymous
Not applicable
Author

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
Anonymous
Not applicable
Author

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.

Not applicable
Author

Perfecto, eso era mi error, muchisimas gracias.