Skip to main content

Connectivity & Data Prep

Discussion board where members can learn more about Qlik Sense Data Connectivity.

Announcements
QlikWorld 2023, a live, in-person thrill ride. April 17 - 20, 2023, in Las Vegas! REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
jakobjensen
Contributor II
Contributor II

Rename field in SQL query and not in LOAD

Say I have the following database table

id |   gender 

--+------------

1       M

2      F

 

I want to change the name in the SQL-query and *not* in the LOAD query i.e

 

LIB CONNECT TO 'database';

LOAD customer_id, gender;

[my_table]:
SELECT "id as customer_id","gender"
FROM "public"."table";

 

but I get a load-error since "customer_id" is not found.

 

(note above is just for illustration purpose, the original query is way more complex thus the renaming has to be in the SQL-query and not the LOAD-statement)

1 Reply
tresesco
MVP
MVP

Try correcting the quotes like:

LOAD customer_id, gender;

[my_table]:
SELECT "id" as "customer_id","gender"
FROM "public"."table";