Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Loading column values if not null?

How to check for the column values while loading so that the null values should not get loaded .

And if i want to sum the column value i want to neglect the null value s data . How should i do this?

Thanks

Vikas

2 Replies
deepakk
Partner - Specialist III
Partner - Specialist III

hi Vikas,

YOu can do it by following method.

Load * from Table where isnull(Fieldname) =0

or

Load * from table where len(trim(Fieldname)) >0 ;

Miguel_Angel_Baeyens

Hello Vikas,

In addition to what Deepak suggests, and in regards to sum some values, the above is correct if you don't want to load any records where the field value is null. However, you may want to create a flag in those fields, so you can take them on or off a set analysis easily

Table:LOAD Code, Amount, Date, If(Len(Date) = 0, 1, 0) AS NullFlagFROM File.qvd (qvd) // or any other


and then

Sum({< NullFlag = {1} >} Amount)


Hope that helps.