Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Highlighted
jacob-janvds
New 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?

Tags (2)
1 Solution

Accepted Solutions
Highlighted
jacob-janvds
New Contributor II

Re: Different results in SQL and Qlik script

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
Highlighted
sasiparupudi1
Honored Contributor III

Re: Different results in SQL and Qlik script

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

Highlighted
jacob-janvds
New Contributor II

Re: Different results in SQL and Qlik script

yes, it's the same DB.

Highlighted
sasiparupudi1
Honored Contributor III

Re: Different results in SQL and Qlik script

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

Highlighted
jacob-janvds
New Contributor II

Re: Different results in SQL and Qlik script

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