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

Table Creation

Greetings,

I need enlightements on some basics.

First of all, I've a file which contains data like this :

Kevin, Anne-De-Bretagne Harvard

Jean, School School School School

Basically it just contains a Name and the differents Schools the student has study to.

I need to be able to select a school in a sheet and it will only show the student that have been to this school, but i've no idea how to structure my data model to fit that.

I thought about creating 2 different table one with names and the other with schools but that means i need to write all of the school in the school table and there can be a lot of them for one student.

Thanks for all the answers/advice !

1 Solution

Accepted Solutions
undergrinder
Specialist II
Specialist II

Hi Vincent,

So the school column can contains multiple school.

Try this:

Schools:

Load

     Name,

     splitfield(school,' ') as school

Resident/From

;

After the transformation your table look like below:


Kevin, Anne-De-Bretagne

Kevin,Harvard

Jean, School

Jean, School

Jean, School

Jean, School


The splitfield second parameter is the delimiter of data, and if omitted the 3rd param (which part should return) it returns all of them in multiple rows (like unnest of postgreSQL)


G.

View solution in original post

4 Replies
undergrinder
Specialist II
Specialist II

Hi Vincent,

So the school column can contains multiple school.

Try this:

Schools:

Load

     Name,

     splitfield(school,' ') as school

Resident/From

;

After the transformation your table look like below:


Kevin, Anne-De-Bretagne

Kevin,Harvard

Jean, School

Jean, School

Jean, School

Jean, School


The splitfield second parameter is the delimiter of data, and if omitted the 3rd param (which part should return) it returns all of them in multiple rows (like unnest of postgreSQL)


G.

YoussefBelloum
Champion
Champion

Hi undergrinder

there is no Splitfield function.. you were thinking about Subfield() maybe ?

undergrinder
Specialist II
Specialist II

Hi,

I'm sorry, I was thinking about subfield(), you're right

G.

YoussefBelloum
Champion
Champion

it can be confusing because it really split the field

it is also a solution here.