Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
jleefjcapital
Creator II
Creator II

Using Where Len(Trim())>0 statement to eliminate null values

Hello,

I'm pulling time series data where it's listing out all of the dates regardless of whether there's a corresponding value.   I tried using the Where statement, len(trim())>0 in the data editor, but nothing's changing.  

LOAD

    Date#("date",'YYYY-MM-DD') AS DATE,

     value as AlabamaRGDP,

     value as [REAL GDP],

    'Alabama' as [STATE]

FROM [lib://Real Total Gross Domestic Product by State for Alabama]

(XmlSimple, table is [observations/observation])

WHERE len(trim(value))>0  ;

32 Replies
jleefjcapital
Creator II
Creator II
Author

No, I don't think it's at the script level.  I may need to create a measure to just pull in the dates with values.  Is there a way to do this? 

jleefjcapital
Creator II
Creator II
Author

Does the trim() function define an integer?   I'm not very familiar with either of the functions. 

MarcoWedel

trim just purges leading and trailing blanks as a string operation.

Should also work without like

WHERE Len(value)

regards

Marco

Clever_Anjos
Employee
Employee

You don´t need to download, but upload you .qvw

Preparing examples for Upload - Reduction and Data Scrambling

krishna_2644
Specialist III
Specialist III

LOAD

DATE ,

...

if(len(trim(value))>0,value) as [REAL GDP]

FROM  your_xml_file

WHERE NOT ISNULL(value);



Thanks

krishna_2644
Specialist III
Specialist III

As marco Said Trim() removes both leading and trailing spaces and its a string operation.

eg : a value in the  field called  value is  '   xyz   ' then   the operation trim(value) returns 'xyz'.

and len() calculates the num of chars i.e len(trim(value) returns a number '3'

jleefjcapital
Creator II
Creator II
Author

I don't see the file tab in my Qlik app.  Should I just copy/paste the code? 

jleefjcapital
Creator II
Creator II
Author

Krishna,

It's not working.   Do we need to create a measure? 

krishna_2644
Specialist III
Specialist III

could you please share us the qvw?

jleefjcapital
Creator II
Creator II
Author

How can I upload the qvw file?