Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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?
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......
i am assuming you are not doing a group by. if so try below
"OS_NAME" & ' ' & "OS_VERSION" AS "OS_FULL",
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)
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
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
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......
Don't apply it within the sql else within a preceeding load, like:
table:
load *, YourMergeStatement;
sql select * from ...;
- Marcus
i see you are using oracle. in oracle sql concatete is using pipes. so something like below in sql query
"OS_NAME" ||' ' || "OS_VERSION"
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.