Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem with if statement in script

Hi, I load few tables with the same structure and i want to create simple if statement before every load (except first).

LOAD:

employeemanager
Aman1
Bman2

LOAD:

employee2
manager
Cman5

I just want to check if the last downloaded value in manager field isn't 'man5'. I tried use

if FieldValue('manager', 0)<>'man5'  then

LOAD ...

...

end if

but this doesnt work (I also tried peek), any idea what am i doing wrong ?

3 Replies
Anonymous
Not applicable
Author

You could try this:

LOAD...

WHERE NOT EXISTS(manager,'man5')

Anonymous
Not applicable
Author

Load ...

where manager <>  'man5';

Not applicable
Author

You got me wrong,

What im doing is gathering information about employee from Active Directory - i check his manager and department, then i check the boss of the manager and his department and so on ... until i download data about the head of the company (nobody is higher). And in this point i want to finish execution of the script using some if statement.