Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
CreepyCatLady
Creator
Creator

Concatenate two fields with space in between

Hello all. I have searched the forums for an answer to this and have not found exactly what I need.

I have two fields that I want to combine to make a third. I have successfully accomplished this in the data load editor using the concatenate function as follows:

"OS_VERSION",
CONCAT("OS_NAME", "OS_VERSION") AS "OS_FULL",

Of course, this results in the fields appearing without a space between them. When I try using SQL syntax to add a space, I get an error upon loading the data. I have tried the following to no avail:

"OS_VERSION",
CONCAT("OS_NAME", " ", "OS_VERSION") AS "OS_FULL",  (results in error)

"OS_VERSION",
CONCAT("OS_NAME", ' ', "OS_VERSION") AS "OS_FULL", (results in error)

"OS_VERSION",
CONCAT("OS_NAME" & & "OS_VERSION") AS "OS_FULL", (results in error)

What is the proper Qlik syntax for this, please?

 

Labels (1)
1 Solution

Accepted Solutions
dplr-rn
Partner - Master III
Partner - Master III

you are doing that in the sql statement.

in the sql statement only sql syntax will work. (and that depends on your DB)

what i was suggesting is this

load *

,"OS_NAME" & ' ' & "OS_VERSION" AS "OS_FULL"
;

sql

select......

 

View solution in original post

10 Replies
dplr-rn
Partner - Master III
Partner - Master III

i am assuming you are not doing a group by. if so try below

"OS_NAME" & ' ' & "OS_VERSION" AS "OS_FULL",

CreepyCatLady
Creator
Creator
Author

Correct, I am not doing a group by. I just tried this, both with and without the CONCAT function, and it did not work.

CONCAT("OS_NAME" & ' ' & "OS_VERSION") AS "OS_FULL", (results in error)

"OS_NAME" & ' ' & "OS_VERSION" AS "OS_FULL", (results in error)

("OS_NAME" & ' ' & "OS_VERSION") AS "OS_FULL", (results in error)

 

dplr-rn
Partner - Master III
Partner - Master III

this should not result in error "OS_NAME" & ' ' & "OS_VERSION" AS "OS_FULL",

whats the error you are getting?

share the full statement and the error

CreepyCatLady
Creator
Creator
Author

clipboard_image_0.png

marcus_sommer
MVP
MVP

The suggestion from dilipranjith is correct and should work. Just ensure that the field-wrapping are double-quotes and not just two single-quotes (you may also replace the double-quotes with square-brackets [ ]) and that there are no further issues in your load.

- Marcus

dplr-rn
Partner - Master III
Partner - Master III

you are doing that in the sql statement.

in the sql statement only sql syntax will work. (and that depends on your DB)

what i was suggesting is this

load *

,"OS_NAME" & ' ' & "OS_VERSION" AS "OS_FULL"
;

sql

select......

 

marcus_sommer
MVP
MVP

Don't apply it within the sql else within a preceeding load, like:

table:
load *, YourMergeStatement;
sql select * from ...;

- Marcus

dplr-rn
Partner - Master III
Partner - Master III

i see you are using oracle. in oracle sql concatete is using  pipes. so something like below in sql query

 

"OS_NAME" ||' ' || "OS_VERSION"

 

CreepyCatLady
Creator
Creator
Author

That worked! Thank you so much. I am very green to Qlik and still get confused on where to put code. Thanks again for the help and your patience.