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

why this simple formula does not work in my script?

hi every body,

here is my script :

LOAD KeyTemp1,
ANNEE_CARTO,
MOIS_CARTO,
INSEE,
%KeyField,
%KeyCumul,
OJD_A,
OJD_A_1,

OJD_A - OJD_A_1 as Ecart_M // écart OJD année A vs OJD année A_1

FROM
[D:\QlikviewData\SourceDocuments\VENTES\QVD_zmsd_carto\zmsd_c3_modif.qvd]
(qvd);

OJD_A - OJD_A_1 as Ecart_M is given the difference between OJD_A and OJD_A_1

but for a line, the script gives nothing.why.JPG

Does anyone know why ?

 

Thank you very much

Arnault

si the files attached

 

 

 

1 Solution

Accepted Solutions
wandererroch
Contributor III
Contributor III

I believe QlikView returns a null when adding two fields if one of those fields is null. You'd have to use an if statement to replace null with 0 to get a result.

View solution in original post

4 Replies
wandererroch
Contributor III
Contributor III

I believe QlikView returns a null when adding two fields if one of those fields is null. You'd have to use an if statement to replace null with 0 to get a result.
doespirito
Creator
Creator
Author

thank you i've just try to use this :

if(IsNull(OJD_A),0,OJD_A) as OJD_A,
if(IsNull(OJD_A_1),0,OJD_A_1) as OJD_A_1

in a previous script

before but it still doesen't work 

doespirito
Creator
Creator
Author

 

in fact it works well sorry 

Gysbert_Wassenaar

You can use the rangesum function which will some everything that has a value and will ignore nulls
RangeSum(OJD_A, -OJD_A_1) as Ecart_M

talk is cheap, supply exceeds demand