Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
aveeeeeee7en
Valued Contributor 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

Tags (1)
1 Reply
v_iyyappan
Valued Contributor

Re: Nested If Statement

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.

Community Browser