Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Sai33
Partner - Creator
Partner - Creator

How to write a Where Condition in Load Script for Integer Values

Hello All,

I'm facing a very typical problem with a Integer Value in my Load Script. The following Load Script used to work perfectly when the Datatype in my Source System was 'String'. But, now the Datatype has been changed to 'Integer' and the load doesn't work any more.

LOAD createdtime

from [Source_Table]

Where createdtime>'$(latesttime)';

Please note: The filed createdtime has Datatype as 'Integer' in my source table.

It would be very helpful if someone guides me with the where condition.

Labels (1)
1 Solution

Accepted Solutions
Sai33
Partner - Creator
Partner - Creator
Author

Thanks to everyone for your valuable efforts here.

The actual issue was not with the datatype but a connection setting between Hive and Qlik. The User responsible for loading data from Hive was able to perform the load on one Where condition but not on the other . I had to include the following parameters in the Qlik-Hive connection to solve my issue.

SET hive.execution.engine = tez;

SET tez.queue.name=pr-*;

 

View solution in original post

6 Replies
PrashantSangle

1: check the format of latesttime variable
2: convert both into num, for that use num() or num() or date#() or timestamp#()

Regards,
Prashant Sangle
Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Sai33
Partner - Creator
Partner - Creator
Author

Hi Prashant,

My logic for the variable vlatesttime is to get the Max values from createdtime. So, the format for both the fileds should be the same.

 

Also, how to convert the filed into Num() or Num#() on a where condition.

PrashantSangle

It is difficult to give correct answer without knowing what data you are getting in variable and createdtime

1: check in front end text object         $(latesttime)

2: in front end take filter pane  >>>> createdtime

check format of both. If possible share snip of it.

Regards,

Prashant Sangle

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
andoryuu
Creator III
Creator III

To  @PrashantSangle 's point this should work if your latesttime variable is in integer format, but stored as a string and your createdtime is not stored in the source system as an integer.   If it still doesn't work wrap the createdtime field in num#() also.

 

LOAD createdtime

from [Source_Table]

Where createdtime>num#('$(latesttime)');

Sai33
Partner - Creator
Partner - Creator
Author

Thanks to everyone for your valuable efforts here.

The actual issue was not with the datatype but a connection setting between Hive and Qlik. The User responsible for loading data from Hive was able to perform the load on one Where condition but not on the other . I had to include the following parameters in the Qlik-Hive connection to solve my issue.

SET hive.execution.engine = tez;

SET tez.queue.name=pr-*;

 

vinodkumar
Contributor II
Contributor II

Hi Sai,

I'm using the HIVE connection and facing the same issue like if i pass date in where condition, it is giving error, without where condition it is working fine.

Could you please explain me  where i need to use the SET variables, 

Thanks in advance!