Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

datalakeyu
Valued Contributor

Load and Select data from database problem in Qlik Sense

When I use the following query to load data from database to Qlik sense, Qlik Sense would complain 'no myDate field found'. Could you please give any suggestion? Thanks!

I have connected to the database, and the connection is correct. I can not just use 'Load *, because I would like to some Qlik Sense function during loading data, such as 'GeoMakePoint ', 'Date()'.


Load

     myDate ,

    date_String ,

     myVlaue ,

     latitude ,

     longititude ,

     GeoMakePoint ( latitude , longititude ) as myLocation

Select

     TO_DATE(from_unixtime(UNIX_TIMESTAMP(date_String , 'M/dd/yyyy'))) as myDate ,

     date_String ,

     myVlaue ,

     latitude ,

     longititude

From myTable

1 Solution

Accepted Solutions
MVP & Luminary
MVP & Luminary

Re: Load and Select data from database problem in Qlik Sense

Depending on the database, the myDate in the SQL may be returned upper case. What database is it?

Try a couple things.

1) Refer to it as MYDATE (upper case) in the LOAD statement.

2) Quote in the SQL:

Select

     TO_DATE(from_unixtime(UNIX_TIMESTAMP(date_String , 'M/dd/yyyy'))) as "myDate"

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

6 Replies
otavio_marco
Contributor

Re: Load and Select data from database problem in Qlik Sense

hey...

Missing ';' after myLocation.

Grupo Telegram Qlik Brasil: https://t.me/joinchat/AeRmnUmcxQ02L00g3x-HtQ
datalakeyu
Valued Contributor

Re: Load and Select data from database problem in Qlik Sense

Hi Marco, thanks for your help!

Missing ' ; '  between Load part and Select part is a type error when I copy script from Qlik sense to Qlik community.

When I run the query with ' ; ' in the above query, Qlik sense would complain: Field not found - <myDate>

Any suggestion is appreciated!

MVP & Luminary
MVP & Luminary

Re: Load and Select data from database problem in Qlik Sense

Depending on the database, the myDate in the SQL may be returned upper case. What database is it?

Try a couple things.

1) Refer to it as MYDATE (upper case) in the LOAD statement.

2) Quote in the SQL:

Select

     TO_DATE(from_unixtime(UNIX_TIMESTAMP(date_String , 'M/dd/yyyy'))) as "myDate"

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

otavio_marco
Contributor

Re: Load and Select data from database problem in Qlik Sense

Is true. In Oracle DB exists only upper fields x.x

Grupo Telegram Qlik Brasil: https://t.me/joinchat/AeRmnUmcxQ02L00g3x-HtQ
datalakeyu
Valued Contributor

Re: Load and Select data from database problem in Qlik Sense

Rob , thanks so much for your help!
I use Oracle.
1) Refer to it as MYDATE in the LOAD part, works.
2):Add " " to myDate at Selection part, also works.

Highlighted
datalakeyu
Valued Contributor

Re: Load and Select data from database problem in Qlik Sense

when I load data from Apache Hive table, all the field name is lower case. Be careful about the upper/lower case.