Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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?
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
If by definition this column contains numerical information, you can also use the following:
Alt(Field, -999) AS Field
I think tha i manage i misstake, the problem is that when i import a table as;
Kind | Item | Units |
2015(Jan_Feb) | 413001 | 2 |
2015(Mar_June) | 413001 | 3 |
2015(July_Dec) |
for 2015(July-Dec) provide to me - and i want that throw the script ( if is possible) replace the "-" by "0"
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
I tried and doesn´t run..
I think tha i manage i misstake, the problem is that when i import a table as;
Kind | Item | Units |
2015(Jan_Feb) | 413001 | 2 |
2015(Mar_June) | 413001 | 3 |
2015(July_Dec) |
for 2015(July-Dec) provide to me - and i want that throw the script ( if is possible) replace the "-" by "0"
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
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
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.
doesn´t run i tried on script and on the visualization mode and no results.
Any other idea?