Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
aveeeeeee7en
Specialist III
Specialist III

Nested If Statement

Hi Community

    

IDDivisionDepartmentCentreGroup
1111AAAZZZAZZA
2222YYYBY
3333BBBXXX
4444WWWCW

Condition to be used if Group is Blank:

if((len(trim(Group))<1 and len(trim(Centre))<1 and len(trim(Division))<1),Department,

if((len(trim(Group))<1 and len(trim(Centre))<1 and len(Division)>1),Division,

if((len(trim(Group))<1 and len(Centre)>1 and len(trim(Division))<1),Centre,Group)))   AS Group

Is the Above Expression used is Correct.............................????

Above Expression Description:

if(Group is Blank  and Centre is Blank and Division is Blank, Department,

if(Group is Blank and Centre is Blank and Division is NOT Blank, Division,

if(Group is Blank and Centre is NOT Blank and Division is Blank, Centre, Group)))

How to achieve this.

Regards

Aviral Nag

1 Reply
v_iyyappan
Specialist
Specialist

Hi,

Try like this

// Load the Excel files

Table1:

Load

ID,

Division,

Department,

  Centre,

Group

From Table1:

Table2:

Load

ID,

Division,

Department,

  Centre,

if((IsNull(Group) <> 0 And IsNull(Centre) <> 0 and IsNull(Division) <> 0),Department,

  if((IsNull(Group) <> 0 And IsNull(Centre) <> 0 and IsNull(Division) = 0), Division,

   if((IsNull(Group) <> 0 And IsNull(Centre) = 0 and IsNull(Division) = 0), Centre))) AS Group

Resident Table1;

Hope its help

Regards,

Iyyappan.