Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello
I have an IF statement where I need to incorporate an apostrophe
How would I possibly reqrite the If statement to get around the fact that I ahve an apostrophe, beacuse as the moment I am getting an error message if I run the script
If Statement
If(Breach_Location = 'Paed's Waiting' Or Breach_Location = 'Paeds Wait1' or Breach_Location
= 'Paeds Wait2', 'Paediatrics Waiting',
This is only part of a larger IF statement
Error Message:
Error in expression:
')' expected
Thanks
Helen
If(Breach_Location = 'Paed' &chr(39)&'s Waiting' Or Breach_Location = 'Paeds Wait1' or Breach_Location
= 'Paeds Wait2', 'Paediatrics Waiting',' Some Text')
use above .
hope this helps
Hi Helen,
Let do this
If(
Breach_Location = 'Paed's Waiting' Or
Breach_Location = 'Paeds Wait1' or
Breach_Location = 'Paeds Wait2',
'Paediatrics Waiting', 'Others'
)
Regards,
Sokkorn
If(Breach_Location = 'Paed' &chr(39)&'s Waiting' Or Breach_Location = 'Paeds Wait1' or Breach_Location
= 'Paeds Wait2', 'Paediatrics Waiting',' Some Text')
use above .
hope this helps
Or you can use Match function
IF(Match(Breach_Location, 'Paed's Waiting', 'Paeds Wait1', 'Paeds Wait2'),'Paediatrics Waiting','Other')
Regards,
Sokkorn
Thanks for your response
I have tried both of you who ahve kindly replied techniques, but I still get an error message
Perhaps if I teel you the entire IF statement, you will be kind enough to help me rewrite it
If(Breach_Location = 'Paeds Bay 1' or Breach_Location = 'Paeds Bay 2' or Breach_Location = 'Paeds Bay 3'
or Breach_Location = 'Paeds Bay 4' or Breach_Location = 'Paeds Bay 5' or Breach_Location = 'Paeds Side Room', 'Paediatrics',
If(Breach_Location = 'Paed's Waiting' Or Breach_Location = 'Paeds Wait1' or Breach_Location = 'Paeds Wait2', 'Paediatrics Waiting',
If(Breach_Location = 'Resus 1' or Breach_Location = 'Resus 2'or Breach_Location = 'Resus 3' or Breach_Location = 'Resus 4' or Breach_Location = 'Resus 5'
or Breach_Location
= 'Resus 6', 'Resus',
)))) as Test
The highlighted part is causing me problems
Any help would be greatly appreciated
Hi
You could also try
if(Replace(Breach_Location
,chr(39),' ')='Paed s Waiting'
Or Breach_Location = 'Paeds Wait1' or Breach_Location
= 'Paeds Wait2', 'Paediatrics Waiting',' Some Text')
Kind Regards,
Footsie
Hello Helen,
You can use the command chr(39), as per luminary's example
This will tell QlikView to insert the ascii letter for code 39, with is the ' symbol, useful when you need to include symbols that QlikView uses as part of the expressions.
Sounds like an interesting app if it’s counting breach time and amounts etc.
Hi Helen,
Maybe this one can help
If(
Match([Breach_Location],'Paeds Bay 1','Paeds Bay 2','Paeds Bay 3','Paeds Bay 4','Paeds Bay 5','Paeds Side Room'), 'Paediatrics',
If(
Match([Breach_Location],'Paed' & Chr(39) & 's Waiting','Paeds Wait1','Paeds Wait2'), 'Paediatrics Waiting',
If(
Match([Breach_Location],'Resus 1','Resus 2','Resus 3','Resus 4','Resus 5','Resus 6'), 'Resus'
))) as Test
Regards,
Sokkorn
have tried Chr(39) as i suggested above
If(Breach_Location = 'Paeds Bay 1' or Breach_Location = 'Paeds Bay 2' or Breach_Location = 'Paeds Bay 3'
or Breach_Location = 'Paeds Bay 4' or Breach_Location = 'Paeds Bay 5' or Breach_Location = 'Paeds Side Room', 'Paediatrics',
If(Breach_Location='Paed' &chr(39)&'s Waiting' Or Breach_Location = 'Paeds Wait1' or Breach_Location = 'Paeds Wait2', 'Paediatrics Waiting',
If(Breach_Location = 'Resus 1' or Breach_Location = 'Resus 2'or Breach_Location = 'Resus 3' orBreach_Location = 'Resus 4' or Breach_Location = 'Resus 5'
or Breach_Location
= 'Resus 6', 'Resus',
)))) as Test
hope this helps
Hi helen_pip,
Please try this.It will solve your problem.
If(Breach_Location = 'Paed'&chr(39)&'s Waiting' Or Breach_Location = 'Paeds Wait1' or Breach_Location
= 'Paeds Wait2', 'Paediatrics Waiting',
Let me know.