Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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

Labels (1)
6 Replies
ramoncova06
Partner - Specialist III
Partner - 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
Partner - Champion III
Partner - Champion III

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
MVP
MVP

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