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

Condition If

hello

I have a problem with if condition when i insert a formula,

this is my script

= if(interval([OV_DATA_CONS_RICH-OV_DATA_BOLLA],<-5),'Ritardo',

   if(interval([OV_DATA_CONS_RICH-OV_DATA_BOLLA],>=-5),'Puntuale',

   if(interval([OV_DATA_CONS_RICH-OV_DATA_BOLLA],''),'Non Consegnato')))

thanks in advance

6 Replies
ramoncova06
Specialist III
Specialist III

try with this

= if(interval([OV_DATA_CONS_RICH-OV_DATA_BOLLA]),<-5,'Ritardo',

   if(interval([OV_DATA_CONS_RICH-OV_DATA_BOLLA]),>=-5,'Puntuale',

   if(interval([OV_DATA_CONS_RICH-OV_DATA_BOLLA]),'','Non Consegnato')))

you had the condition evaluation as part of the interval function

Chanty4u
MVP
MVP

try this

= if(interval([OV_DATA_CONS_RICH-OV_DATA_BOLLA])<-5,'Ritardo',

   if(interval([OV_DATA_CONS_RICH-OV_DATA_BOLLA])>=-5,'Puntuale',

   if(interval([OV_DATA_CONS_RICH-OV_DATA_BOLLA]),'Non Consegnato')))

jonathandienst
Partner - Champion III
Partner - Champion III

The use of interval here is redundant, It is a formatting function only and does not affect the calculations. What you require is not entirely clear due to the syntax errors in your expression, but perhaps you need this:

= if([OV_DATA_CONS_RICH-OV_DATA_BOLLA] < -5,'Ritardo',

  if([OV_DATA_CONS_RICH-OV_DATA_BOLLA] >= -5,'Puntuale','Non Consegnato'))

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jagan
Luminary Alumni
Luminary Alumni

Hi,

Check this

= if([OV_DATA_CONS_RICH-OV_DATA_BOLLA]<-5,'Ritardo',

   if([OV_DATA_CONS_RICH-OV_DATA_BOLLA]>=-5,'Puntuale',

  'Non Consegnato'))

Regards,

Jagan.

Kushal_Chawda

what you want to achieve? can you explain the logic?

Not applicable
Author

i found the solution in this way:

=if(OV_DATA_CONS_RICH-OV_DATA_BOLLA<<0, 'Ritardo',if(OV_DATA_CONS_RICH-        OV_DATA_BOLLA>>0,'Puntuale','Non Consegnato'))

the problem was that it read the second incorrectly condition

thank you all