Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
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

Qrishna
Master
Master

LOAD

DATE ,

...

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

FROM  your_xml_file

WHERE NOT ISNULL(value);



Thanks

Qrishna
Master
Master

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? 

Qrishna
Master
Master

could you please share us the qvw?

jleefjcapital
Creator II
Creator II
Author

How can I upload the qvw file?