Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to integrate a figure if doesn´t come on the load

IF I load a table with no data in one column and i want that by default if the column has no data pint for me a numer... How i can do it?

11 Replies
rahulpawarb
Specialist III
Specialist III

Hello Jesus,

You can do the validation check on that field. For example, If(Len(Field)>0,Field, -999) AS FieldName

Please correct me If I misunderstood the requirement.

Regards!

Rahul

Peter_Cammaert
Partner - Champion III
Partner - Champion III

If by definition this column contains numerical information, you can also use the following:

Alt(Field, -999) AS Field

Not applicable
Author

I think tha i manage i misstake, the problem is that when i import a table as;

   

KindItemUnits
2015(Jan_Feb)4130012
2015(Mar_June)4130013
2015(July_Dec)

for 2015(July-Dec) provide to me - and i want that throw the script ( if is possible) replace the "-" by "0"

sdmech81
Specialist
Specialist

Hi,May be this:

=if(IsNull(Field),'Whatever u wish', Field)

But cross verify wthr filed is really containing Null() or thr is spac..

Fr that u just load the data in qlik and if u see '-' then it NULL and u can go ahead as above.

Sachin

Not applicable
Author

I tried and  doesn´t run..

I think tha i manage i misstake, the problem is that when i import a table as;

  

KindItemUnits
2015(Jan_Feb)4130012
2015(Mar_June)4130013
2015(July_Dec)

for 2015(July-Dec) provide to me - and i want that throw the script ( if is possible) replace the "-" by "0"

rahulpawarb
Specialist III
Specialist III

Hello Jesus,

Could you please share application with sample data? This will help us to understand the root cause and provide fix for the same.

Thank you!

Rahul

sdmech81
Specialist
Specialist

Yess..They r null values :

Try as said above U can put like:

=if(IsNull(Field),0, Field)


This will replace the the "-" by "0" ..

Hope u try and it helps!!

Sachin

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Try like this:

RawData: // Note: Num#() only required in INLINE Load

LOAD Kind, Item, Alt(Num#(Units),0) AS Units INLINE [

Kind, Item, Units

2015(Jan_Feb), 413001, 2

2015(Mar_June), 413001, 3

2015(July_Dec),,

];

I omitted the same logic from the Item column because a 0 (zero) is not a good replacement to indicate "no product ID". Null or "UNKNOWN" is better in that case.

BTW this is just an example. I you want to aggregate data, you may want to add some additional process steps. But the first one should include Data Quality checks and for that you can use the Alt() function.

Not applicable
Author

doesn´t run i tried on script and on the visualization mode and no results.

Any other idea?