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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
amien
Specialist
Specialist

load should fill in the missing values not as null but as 0

double post

22 Replies
amien
Specialist
Specialist
Author

/bump

Not applicable

Try theNullDisplay() statement. Use set NullDisplay='0' in your script before the LOAD statements. Only for ODBC though.

If you want the NULL value to be selectable and linkable for certain fields, you can also use the NullAsValue statement.

Best look both up in the QV help 🙂

amien
Specialist
Specialist
Author

not using ODBC 😞 ..

NullAsValue gives same result.

thanks for the input though

Not applicable

Ah, why not change the way a NULL value is shown then ... Go to the Presentation tab and change Null-symbol (bottom left) from '-' to '0'. Also change the way the alignment for field 'filenumber' to Right for the data(text) (top right options). That way they are all aligned on the right.

You still can't select the value (still is NULL), but the display has changed. Tried this with your code.

amien
Specialist
Specialist
Author

because then my timeline / rangesum doesnt work properly

Not applicable

True ... you would need the real value '0' for that.

Try this (worked for me 😉 )


for j=200901 to 200912

basic:
LOAD * INLINE [
date
$(j)
];

next j;


Calculation:
LOAD * INLINE [
date, filenumber, value
200901, 1, 500
];

CONCATENATE
LOAD
date,
'0' AS filenumber,
'0' AS value
RESIDENT basic;


Update: you do get two 200901 lines with this. SO we need something to remedy that 🙂

amien
Specialist
Specialist
Author

Thanks for your reply

well .. i need 12 lines for filenumber 1

200901 with value 500, rest with 0

i now have lots of:

filenumber,date,value

0, 200901, 0

...

0, 200912, 0

Not applicable

So, more like this?


CONCATENATE
LOAD
date,
'1' AS filenumber,
'0' AS value
RESIDENT basic;


This Concatenation will give you all 12 dates with filenumber=1 and only value 500 for the first date and 0 for the other values.

amien
Specialist
Specialist
Author

that looks what i need .. only problem is that where are plenty of filenumbers .. not just one 🙂

for example:

Calculation:
LOAD * INLINE [
date, filenumber, value
200901, 1, 500
200902, 2, 500
];