Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikview979
Specialist
Specialist

Splitting the single column data in to multiple columns

Hi Experts,

I am facing one issue in creating map in Qlik sense. I have Region, division and territory all in one column called Level name and its data in another column called Position Name . Hence i am writing if condition to get them as three different fields.

LOAD LEVEL_NAME,

     PARENT_POSITION_NAME,

     POSITION_NAME,

     if(LEVEL_NAME='REGION',POSITION_NAME) as Region,

     if(LEVEL_NAME='DIVISION',POSITION_NAME) as Division,

     if(LEVEL_NAME='TERRITORY',POSITION_NAME) as Territory

    

FROM

(ooxml, embedded labels, table is Sheet1);

But i am not getting any association between these fields. Please find the snap shot below. I have attached qvf and data file as well.

my data is as below format ,using this data its very difficult to create association between Region,Division,Territory .

hence help me to split Level name field into three columns called Region,Division & Territory. And also help me to create the association between them.

Untitled.png

Capture1.PNG

stalwar1loveisfail

4 Replies
amilafdo
Creator
Creator

Hi,

Use below code instead of the above code.

LOAD LEVEL_NAME,

if(LEVEL_NAME='DIVISION',LEVEL_NAME) as DIVISION,

if(LEVEL_NAME='REGION',LEVEL_NAME) as REGION,

if(LEVEL_NAME='NATION',LEVEL_NAME) as NATION,

if(LEVEL_NAME='TERRITORY',LEVEL_NAME) as TERRITORY,

     PARENT_POSITION_NAME,

     POSITION_NAME

Regards

Amila

Anonymous
Not applicable

Use Hierarchy load instead of load

Hierarchy ‒ QlikView

jonathandienst
Partner - Champion III
Partner - Champion III

You will need to do something like this:

TEMP:

LOAD *

FROM

(ooxml, embedded labels, table is Sheet1); 

FINAL:

LOAD LEVEL_NAME,

     PARENT_POSITION_NAME,

     POSITION_NAME,

  POSITION_NAME as Region

RESIDENT TEMP

Where LEVEL_NAME='REGION';

Join(FINAL) 

LOAD LEVEL_NAME,

     PARENT_POSITION_NAME,

     POSITION_NAME,

  POSITION_NAME as Division

RESIDENT TEMP

Where LEVEL_NAME='DIVISION';

Join(FINAL)

LOAD LEVEL_NAME,

     PARENT_POSITION_NAME,

     POSITION_NAME,

  POSITION_NAME as Territory

RESIDENT TEMP

Where LEVEL_NAME='TERRITORY';

  

DROP Table TEMP;

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
neha_shirsath
Specialist
Specialist

Try below new field in your script-

if(WildMatch(LEVEL_NAME,'REGION'), 'Region',

     if(WildMatch(LEVEL_NAME,'DIVISION'),'Division',

     if(WildMatch(LEVEL_NAME,'TERRITORY'), 'Territory'))) as POSITION_NAME1