Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Everyone ,
Have you experienced a case when SQL executed on SSMS gives different records compared to when its run in Qlik View (using SQL: keyword)
I get few extra records in Qlik for some reason and am trying to find the reason for this.
Sample script
SQL
Select a.id , x , y , z FROM tablea a INNER JOIN tableb a ON a.id = b.id
The only difference is I am storing both the tables in separate QVDs and joining in Qlik
Qlik Script
[TableA]
Load *;
SQL:
select * from TableA;
store [TableA] into(TableA.qvd)(qvd)
[TableB]
Load *;
SQL:
select * from TableB;
store [TableB] into(TableB.qvd)(qvd)
And in the Final App:
[Result Table]:
Load
Id ,
A
from [TableA.qvd](qvd);
inner join
Load
ID,
B
from [TableB.qvd](qvd)
TL;DR : Can a same SQL query generate different results when executed in native environment(SSMS) vs when executed in QLIK
Thank You,
Ankit Madhukar
Hi,
Take new qvw/qvf and do following and see .
instead of loading as a table in Qlik.
directly load sql table and check the count?
Hi @Chanty4u ,
I think I overlooked the fact that Qlik is case sensitive whereas SQL is not 🙂
That was the cause of deviations in the count distinct case
Have made the required changes and will check the data load.
Thanks!
To add to this ,
I am getting minor deviations only.
Data matches as is for months till March , but after that I see these deviations.
Thanks!
After loading into Qvd . did you check individual table count?
Hi @Chanty4u ,
The number of records are different in QVD to SQL result (using same SQL query)
For one of the table , I am getting the same number of records , but count distinct gives different result in SQL compared to QLIK.
I read how distinct is interpreted in QLIK in cases of joins and concatenates so I loaded that single table but still got the same result. The number of distinct count for one of the field in SQL does not match to that of Qlik.
Is there any thing I am missing here regarding this.
set analysis used : Count( Distinct FieldName)
SQL : SELECT count(distinct FieldName) from tableA
Hi,
Take new qvw/qvf and do following and see .
instead of loading as a table in Qlik.
directly load sql table and check the count?
Hi @Chanty4u ,
I think I overlooked the fact that Qlik is case sensitive whereas SQL is not 🙂
That was the cause of deviations in the count distinct case
Have made the required changes and will check the data load.
Thanks!
great ! you are able to figure out the issue . please close this thread .