Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

If statement...

Hi,

I am trying to add an IF statement in my where clause on load editor but does not seem to be working. Can someone please help?

The IF statement is being used on two different columns to filter for 'GB'. So as long as one column contains 'GB' then return it.

TABLE:

IDOriginDestination
1SYDGB
2SINAU
3GBUS
4GBGB
5AUSYD

So from the table above it would exclude ID's 2 and 5.

Hope this makes sense.

Thanks

4 Replies
william_fu
Creator II
Creator II

LOAD * Inline [

ID, Origin, Destination

1, SYD, GB

2, SIN, AU

3, GB, US

4, GB, GB

5, AU, SYD]

WHERE (Origin = 'GB' OR Destination = 'GB');

wdchristensen
Specialist
Specialist

LOAD

ID,

Origin,

Destination

FROM 'SomeSource'

WHERE Origin = 'GB' OR Destination = 'GB';

marcus_sommer

You could use: ... where Origin = 'GB' or Destination = 'GB';

- Marcus

priyalvp24
Creator
Creator

LOAD

ID,

Origin,

Destination

FROM 'SomeSource'

WHERE NOT MATCH(ID,2,5);