Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

[ASK] different version - why the result in sql with the qlikview is different?

hello..

i have a problem with this, again..

in sql i do this :

SELECT SUM(coraccountdetail.payment) as sum_payment

FROM coraccount,coraccountdetail,corpayment

WHERE coraccount.norek = coraccountdetail.norek

AND coraccount.nopin = coraccountdetail.nopin

and coraccountdetail.nopin=corpayment.nopin

and coraccountdetail.norek=corpayment.norek

and corpayment.paymentid = coraccountdetail.paymentid_CAD

and coraccount.closetype = 0

and the result is :

sum_payment : 11275726357

when i try on qlikview with this syntax :

sum(if(closetype_CA=0 and PaymentId=paymentidpokok_CAD ,payment_CP))

and the result is :

sum_payment : 11678026889

on qlikview,

table coraccount and coraccountdetail is connected by nopin_CA and norek_CA

table coraccountdetail and corpaymen is connected by nopin_CAD and norek_CAD

and why the result is different?

many thx...

3 Replies
suniljain
Master
Master

pls use Trim() in If condition . and also chaeck whether link is proper between

table coraccount and coraccountdetail is connected by nopin_CA and norek_CA ,

and

table coraccountdetail and corpaymen is connected by nopin_CAD and norek_CAD

or not.

I think there is problem in link between table or linking key is not proper.

Regards

Sunil Jain.

Not applicable
Author

@Sunil

hello Sunil..

i've tried :

-sum(trim(if(closetype_CA=0 and PaymentId=paymentidpokok_CAD ,payment_CP)))

-sum(if(closetype_CA=0 and PaymentId=paymentidpokok_CAD ,trim(payment_CP)))

-sum(if(trim(closetype_CA=0 and PaymentId=paymentidpokok_CAD) ,payment_CP))

-sum(if(trim(closetype_CA=0) and PaymentId=paymentidpokok_CAD ,payment_CP))

-sum(if(closetype_CA=0 and trim(PaymentId=paymentidpokok_CAD) ,payment_CP))

but nothing's change..

😞

llauses243
Creator III
Creator III

are idem paymentidpokok_CAD (Qlikview) & paymentid_CAD (sql) ?