Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
hopkinsc
Partner - Specialist III
Partner - Specialist III

Help with If statement

Hi all, i can't think properly today!

i am trying to create a new field in the script with the following conditions.

I have 6 fields (3 new and 3 old as below)

BusinessUnit

BusinessUnit_OLD

Department

Department_OLD

Division

Division_OLD

I want to create a flag field 'RoleChange_Flag' if the above do not match each other , i.e. if BusinessUnit <> BusinessUnit_OLD then 1 as RoleChange_Flag.

but i want RoleChange_Flag to be populated if either of them are different, so something like..

if(BusinessUnit<>BusinessUnit_OLD,1 or if(Department<>Department_OLD,1 or if(Division<>Division_OLD,1))) as RoleChange_Flag

I can't seem to get the syntax right.

any help would be appreciated

1 Solution

Accepted Solutions
m_woolf
Master II
Master II

if(BusinessUnit<>BusinessUnit_OLD or Department<>Department_OLD or Division<>Division_OLD,1) as RoleChange_Flag

View solution in original post

3 Replies
m_woolf
Master II
Master II

if(BusinessUnit<>BusinessUnit_OLD or Department<>Department_OLD or Division<>Division_OLD,1) as RoleChange_Flag

MK_QSL
MVP
MVP

If(BusinessUnit <> BusinessUnit_OLD or Department <> Department_OLD or Division <> Division_OLD,1) as RoleChange_Flag

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

ahh, i was certain i needed to use multiple if statements!

Thankyou!