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

Optimizar o mejorar if

Se puede mejorar esta sentencia if

=if(NIVEL_2='mtrCMB','mtrCMB',

if(NIVEL_2='mtrGPO','mtrGPO',

if(NIVEL_2='mtreUSA','mtrUSA')))

1 Solution

Accepted Solutions
erichshiino
Partner - Master
Partner - Master

Hi,

You can try this

= if( NIVEL_2 = 'mtrCMB' OR NIVEL_2 = 'mtrGPO' or NIVEL_2 = 'mtreUSA' , NIVEL_2)

or

If  mtr is a pattern of the beggining of all the values you want, this can become:

= if( left( NIVEL_2, 3) = 'mtr', NIVEL_2)

Hope this helps,

Erich

View solution in original post

3 Replies
erichshiino
Partner - Master
Partner - Master

Hi,

You can try this

= if( NIVEL_2 = 'mtrCMB' OR NIVEL_2 = 'mtrGPO' or NIVEL_2 = 'mtreUSA' , NIVEL_2)

or

If  mtr is a pattern of the beggining of all the values you want, this can become:

= if( left( NIVEL_2, 3) = 'mtr', NIVEL_2)

Hope this helps,

Erich

Not applicable
Author

creo que se puede mejorar hasta:

=NIVEL_2

Not applicable
Author

Hi Erich,

The second It's Correct!!