Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Not applicable

ODBC Connection

I have a Qlikview application that uses and ODBC connection to get data from a database table. I am trying to set an alias for two fields, so that the fields will appear as lowercase values. This is not working for me and I am not sure how to force the alias for the field name to be loaded as lower case.

SELECT


N.ACCOUNT_ID,
N.NAME_ID,
AD.ZIP_CODE,
Z.LATITUDE as latitude,
Z.LONGITUDE as longitude,
Z.DMA,
Z.STATE,
Z.STATION_SUPPORT

FROM

NAMES N,

ADDRESSES AD,

ZIP_CODE Z

WHERE N.ACCOUNT_ID = AD.ACCOUNT_ID

and N.PREFERRED_ADDRESS_ID = AD.ADDRESS_ID

AND AD.ZIP_CODE = Z.ZIP_CODE

When you go to the expression builder, the field names appear in all upper case, but I need them to be in lower case as the alias in the script.

Can anyone help???

1 Solution

Accepted Solutions
Not applicable

Re: ODBC Connection

I found the answer: add the following statement prior to the sql select statement.

ALIAS LONGITUDE as longitude, LATITUDE as latitude;

SELECT

N.ACCOUNT_ID,

N.NAME_ID,

AD.ZIP_CODE,

Z.LATITUDE,

Z.LONGITUDE

FROM ....

This worked.

7 Replies
Not applicable

ODBC Connection

have you tried using a preceding Load to see how it affects it?

Not applicable

Re: ODBC Connection

I am new to Qlikview, so not familiar with all the functionality. Can you give me an example?

Not applicable

ODBC Connection

I believe it would look something like this for you. you just do all the name changing and any other changes here.

Load

N.ACCOUNT_ID as 'Account ID',
N.NAME_ID as 'Name ID',
AD.ZIP_CODE as 'Zip Code',
Z.LATITUDE as Latitude,
Z.LONGITUDE  as Longitude,
Z.DMA as DMA,
Z.STATE as State,
Z.STATION_SUPPORT as 'Station Support';

SELECT

Highlighted
jduenyas
Contributor III

ODBC Connection

There is actually no need for the Load statement.

Simply alias each field to the way you want it to be like such:

N.ACCOUNT_ID AS Account_ID,

N.NAME_ID AS Name_ID,

AD.ZIP_CODE AS Zip_Code,

Z.LATITUDE as latitude,

Z.LONGITUDE as longitude,

Z.DMA AS dma,

Z.STATE As State,

Z.STATION_SUPPORT As Station_Support

Etc.

Not applicable

Re: ODBC Connection

I have aliased the field, however after the data is loaded it does not keep the mixed case, the field names all display as upper case.

Not applicable

ODBC Connection

The correct answer is to put an alias before the select statement:

ALIAS LONGITUDE as longitude, LATITUDE as latitude;

This resolved the issue.

Not applicable

Re: ODBC Connection

I found the answer: add the following statement prior to the sql select statement.

ALIAS LONGITUDE as longitude, LATITUDE as latitude;

SELECT

N.ACCOUNT_ID,

N.NAME_ID,

AD.ZIP_CODE,

Z.LATITUDE,

Z.LONGITUDE

FROM ....

This worked.

Community Browser