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

SQL issue

Hello I'm trying to do a select from a data based. no issue with this.

My problem is that I have a field1 with some data which could be like :

Field1:

data1 / data2

data4

data5

data6

Data7/data8

Field2:

input

input

input ...

I would like to put de data in the field one in with 1 data by row and for sure this is not the case when I do something like this:

SQL select * from table. for sure I've to apply a trick but I don't know which one 😞

how can separate data1/data2 and data7/data8 ? 

thank you for your help.

Best regards,

Patrick

1 Solution

Accepted Solutions
fvelascog72
Partner - Specialist
Partner - Specialist

Hi,

Maybe be:

Load

     *,

     Subfield(PurgeChar(fields1,''),',')

;
SQL select distinct *
FROM table1;


Saludos

View solution in original post

9 Replies
YoussefBelloum
Champion
Champion

Hi,

what do you mean by:

I would like to put de data in the field one in with 1 data by row ?

patrou38
Creator
Creator
Author

in fact I would like to retrieve in my data in a single column with 1 data by row .

after this this data will be a Key between tables in my data model

fvelascog72
Partner - Specialist
Partner - Specialist

Hi,

Try with:

SubField(PurgeChar(Field1, ' '), '/')

Saludos

YoussefBelloum
Champion
Champion

the solution of Frederico below will work then

patrou38
Creator
Creator
Author

sorry but I don't see how I can put it in my SQL select .....

and beside this it will remove the separator but I will have 2 data in the same row (even if  there is no more separator), no ?

stigchel
Partner - Master
Partner - Master

Use a preceding load, the subfield will create a row for each subfield value

Load SubField(PurgeChar(Field1, ' '), '/') as Field1,Field2;

SQL Select Field1, Field2

From Table;

patrou38
Creator
Creator
Author

Hello Piet,

thank you for your answer. this works properly to remove the concerned character 🙂

last blocking point, how can I load all fields from the table including the filter you suggested to me ?

when I try why the script below it doesn't work 😞

Load Subfield(PurgeChar(fields1,''),',');
SQL select distinct *
FROM table1;

thank you in advance .

Regards,

Patrick

fvelascog72
Partner - Specialist
Partner - Specialist

Hi,

Maybe be:

Load

     *,

     Subfield(PurgeChar(fields1,''),',')

;
SQL select distinct *
FROM table1;


Saludos

patrou38
Creator
Creator
Author

great, it woarks .

thank you for all