Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

schefflera
Not applicable

add Space into inline table

Hi Folks,

I have some trouble with an inline table command.

I would like to add a Table with r,g,b color codes for our different branch.

So i created following command:

Load

    *,

    rgb(r,g,b) as LagerFarbe;

LOAD *

Lager, r, g, b

München             , 109, 110, 33

Hamburg             , 111, 120, 22 

];

store LagerFarbe into LagerFarbe.qvd(qvd);

The problem is actually, that i get a table without the spaces above and so i can t associate the table to the other data I have. I need 20 characters per each branch. E. g. for "München" I would need 13 spaces in addition.

Is there any command that i can add space to the dataset like fill or string or everything like this?

Thx for your help in advance.

Felix

1 Solution

Accepted Solutions
MarcoWedel
Not applicable

Re: add Space into inline table

Hallo Felix,

I guess Bill's suggestion to avoid leading or trailing spaces at all is the best thing you can do.

If for whatever reason you can't, then this could be a solution:

set verbatim=1;

Load

    *,

    rgb(r,g,b) as LagerFarbe

Inline [

Lager, r, g, b

München            , 109, 110, 33

Hamburg            , 111, 120, 22

];

hope this helps

regards

Marco

6 Replies
mwoolf
Not applicable

Re: add Space into inline table

In a preceding load:

If(len(Lager)<20,Lager & repeat(' ',20-len(Lager)) as LagerTemp

bill_markham
Not applicable

Re: add Space into inline table

Why not use Trim(Lager) on all the table Loads that load the Lager field ?

That way they will all associate and you won't end with the various issues trailing and leading spaces can cause.

MarcoWedel
Not applicable

Re: add Space into inline table

Hallo Felix,

I guess Bill's suggestion to avoid leading or trailing spaces at all is the best thing you can do.

If for whatever reason you can't, then this could be a solution:

set verbatim=1;

Load

    *,

    rgb(r,g,b) as LagerFarbe

Inline [

Lager, r, g, b

München            , 109, 110, 33

Hamburg            , 111, 120, 22

];

hope this helps

regards

Marco

schefflera
Not applicable

Re: add Space into inline table

Hi all,

thank you very much for your help.

set verbatim=1; and the repeat function didn t work.

I thought about trim as well but was afraid it could change some entries in other tables.

Finally I gave it a try and it works fine.

Again, thx for your help.

Cheers

Felix

MarcoWedel
Not applicable

Re: add Space into inline table

just to prove to other readers of this thread that

SET verbatim=1;

indeed enables leading or trailing spaces:

QlikCommunity_Thread_190414_Pic1.JPG

regards

Marco

schefflera
Not applicable

Re: add Space into inline table

Hi Marco,

thx for your hint again.

Yes it really works for me also now, but also for all other tables.

So it would be good to mention, to set verbatim = 0; after using it if you don`t want

to set the spaces for all following tables.

kind regards

Felix