Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
schefflera
Contributor III
Contributor III

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

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

View solution in original post

6 Replies
m_woolf
Master II
Master II

In a preceding load:

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

Anonymous
Not applicable

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

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
Contributor III
Contributor III
Author

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

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
Contributor III
Contributor III
Author

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