Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
soniasweety
Master
Master

if condition in script

hi all,

I want create a Yes/no  through  if condition how to create this?

logic is :

if(Act_start>PlanStart  and ActEnd<=Plan_End  )    

timeformat : 2018-01-22 15:00:28.000

can anyone help on this?

Thanks

Sony

7 Replies
Anil_Babu_Samineni

If All fields are same format? Why not simply

if(Act_start>PlanStart  and ActEnd<=Plan_End, 'Yes', 'No') as Flag

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
soniasweety
Master
Master
Author

yes its all same.

I need one more also like   is it correct or not?  with multi values

if(code='Success' or code='Success With No Issues', 'EF','NotEF') as  EF_Flag,

shiveshsingh
Master
Master

if(code='Success' or code='Success With No Issues', 'EF','NotEF') as  EF_Flag


Yep it's perfect. You or putting 'OR' condition right.. if any of these conditions get fulfilled, you'll get 'EF' else NotEF

shiveshsingh
Master
Master

if(code='Success' or code='Success With No Issues', 'EF','NotEF') as  EF_Flag


Yep it's perfect, if any of these condition fulfils then EF else NotEF

sasiparupudi1
Master III
Master III

It looks fine but when you are comparing strings care should be taken with the case

another way of doing this especially with multiple values, use match function as it is a lot more neater and sometimes more efficient than if


if(Match(code,'Success' ,'Success With No Issues'), 'EF','NotEF') as  EF_Flag,

MarcoWedel

please close your thread if your initial question is answered:

Qlik Community Tip: Marking Replies as Correct or Helpful

thanks

regards

Marco

Anonymous
Not applicable

if condition in qlikview is :

if(condition , then , else)

as per you requirement:

if (condition,'true','false') as flag


if condition is satisfied,expression returns true/yes else returns false/no.