Skip to main content
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

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
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.