Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
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";