Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

heiko_schmidt
New Contributor

Loop in load statement

Hello everybody, I am facing the following problem:

I load this table:

SQL SELECT

     ordernumber,

    "t_seqe",

    "Text",

    FROM "qlik".dbo."Table";

In this table i have text fields per ordernumber

so the data set could be like this:

ordernumber 10   / "t_seqe" = 1  / Text = "Hello"

ordernumber 10   / "t_seqe" = 2  / Text = "World"


There could be one ordernumber with different sequenze numbers and the Text should be concatenated.

Sometimes i also have a sequenze number 3 or 4 aswell.

What I need at the end is this data set is:


ordernumber 10   / Text = "Hello World"


I hope anybody can help me with this.

Best regards

Heiko



6 Replies
raajaswin
Contributor III

Re: Loop in load statement

Hi you can use concat function

Load

ordernumber,

concat(Text,' ',t_seqe) as Text_Converted

resident <your table> group by ordernumber;

agigliotti
Honored Contributor II

Re: Loop in load statement

what's your expected result?

heiko_schmidt
New Contributor

Re: Loop in load statement

Hello, the original data set is like this:

ordernumber 10   / "t_seqe" = 1  / Text = "Hello"

ordernumber 10   / "t_seqe" = 2  / Text = "World"

ordernumber 10   / "t_seqe" = 3  / Text = "!"

and my expected result is like this:


ordernumber 10   / Text = "Hello World!"


field  "t_seqe" (sequenze number) tells you into how many parts the text had been divided.

field value varries from 1 up to 5

agigliotti
Honored Contributor II

Re: Loop in load statement

I think what raajaswin‌ said above should works for you.

heiko_schmidt
New Contributor

Re: Loop in load statement

Great. It works. Thanks a lot.

MVP
MVP

Re: Loop in load statement

You could do it in a preceding load like:

LOAD

    ordernumber,

    Concat(Text, ' ', t_seqe) as CombinedText

    Group By ordernumber;

SQL SELECT

     ordernumber,

    "t_seqe",

    "Text",

FROM "qlik".dbo."Table";