Qlik Community

Ask a Question

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Talk to Experts Tuesday, January 26th at 10AM EST: Qlik Sense. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Contributor II
Contributor II

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
Contributor II
Contributor II

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
Master III
Master III

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

Contributor II
Contributor II

yes, it's the same DB.

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";

Contributor II
Contributor II

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