Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld Online 2021, May 10-12: Our Free, Virtual, Global Event REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
Sai33
Partner
Partner

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
Partner
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

5 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.
Sai33
Partner
Partner
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.
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
Partner
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