Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Different results in SQL and Qlik script

Hi everyone, Weirdest thing.

I've got the most basic of scripts:

SQL SELECT "CrstId",

"CrstDescr"

FROM "XXX"."dba"."CourseType";

In Qlik Sense, this results in:

001, description

001, another description

002, description3

002, description4

and so on

In SQL, it results in:

001, description

002, description3

and so on.

The SQL statement is copy-paste. Any idea why i receive multiple values (wrong values by the way) in Qlik, but not in SQL Server?

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Sometimes, you need a weekend, or at least in my case I do

Found out by looking at the raw data that Qlik was adding leading zeroes to the actual value in the Id field.

So 001 stayed 001, but 1 became 001.

Adding Text() fixed this for me.

Text ([CrstId]) as [CrstId],

Thanks for your time!

View solution in original post

4 Replies
sasiparupudi1
Master III
Master III

Are you connecting to the same databses?  Hope not to a test db from sense?

Anonymous
Not applicable
Author

yes, it's the same DB.

sasiparupudi1
Master III
Master III

May be you are loading some historic data before the sql stmt?

Try using Preceeding load

T1:

noconcatenate load *

;

SQL SELECT "CrstId",

"CrstDescr"

FROM "XXX"."dba"."CourseType";

Anonymous
Not applicable
Author

Sometimes, you need a weekend, or at least in my case I do

Found out by looking at the raw data that Qlik was adding leading zeroes to the actual value in the Id field.

So 001 stayed 001, but 1 became 001.

Adding Text() fixed this for me.

Text ([CrstId]) as [CrstId],

Thanks for your time!