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

strange OLEDB select result

Hi,

I isolated a bug in my application :

I load data from a MS sql 2008 DB

OLEDB CONNECT TO [...]

select AFF_AFFAIRE,AFF_AFFAIRE1,AFF_AFFAIRE3 from affaire;

now , for a selection that should give me one row, qlikview gives me two :

Capture d’écran 2014-07-31 à 11.14.32.png

If I try the same thing in SQL management studio :

select AFF_AFFAIRE from AFFAIRE where AFF_AFFAIRE1='ITC' and AFF_AFFAIRE3='1312D5'

I get :

AFF_AFFAIRE

AITC592541312D500

which is the correct behavior.

What am i missing ?

Jo.

1 Solution

Accepted Solutions
mrybalko
Creator II
Creator II

You can use code:

affaire: 

LOAD 

    *,

    text(AFF_AFFAIRE3) as AFF_AFFAIRE_; 

select  ....


DROP FIELD AFF_AFFAIRE3;

RENAME FIELD AFF_AFFAIRE_ to AFF_AFFAIRE3;

View solution in original post

21 Replies
Yousef_Amarneh
Partner - Creator III
Partner - Creator III

try Rtrim(Ltrim(AFF_AFFAIRE1))='ITC' and Rtrim(Ltrim(AFF_AFFAIRE3))='1312D5'

Yousef Amarneh
Not applicable
Author

I get the same result. which is correct. the other row should be linked to AFF_AFFAIRE3 = '1312E5' , not 1312D5 :

select AFF_AFFAIRE,AFF_AFFAIRE1,AFF_AFFAIRE3 from AFFAIRE where AFF_AFFAIRE = 'AITC590461312E500';

AFF_AFFAIREAFF_AFFAIRE1AFF_AFFAIRE3
AITC590461312E500ITC1312E5
m_woolf
Master II
Master II

It looks like QlikView is looking at the numeric part of the field for the match. You might use the text() function when you load AFF_AFFAIRE3

Not applicable
Author

sound plausible since the field is tagged with $numeric, $integer.

when I do :

load AFF_AFFAIRE,AFF_AFFAIRE1,text(AFF_AFFAIRE3) from file.qvd (qvd)

- or -

if I try to tag/untag the field before or after my SELECT statement

then the field is then correctly tagged $ascii,$text

but in both case, I get the same issue

thank you for your help

m_woolf
Master II
Master II

Have you tried:

where text(AFF_AFFAIRE3) = '1312E5'

Not applicable
Author

I get 0 lines with this

mrybalko
Creator II
Creator II

Could you share your qvw with strange data?

And do you use the same DB user in QV and SQL manager?

Not applicable
Author

Yes I use the same DB.

here is a trimmed down version of the test file.

the 1312D5 value is aligned right while the other values are aligned left. what does that mean ?

m_woolf
Master II
Master II

The value on the right is considered to be a label.

The values on the left are considered to be numeric.