Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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
In a preceding load:
If(len(Lager)<20,Lager & repeat(' ',20-len(Lager)) as LagerTemp
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.
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
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
just to prove to other readers of this thread that
SET verbatim=1;
indeed enables leading or trailing spaces:
regards
Marco
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