Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
kschramm
Partner - Contributor II
Partner - Contributor II

Using If(len(trim during loading of a column

Hi.  Using QV, I am loading data from  a QVD and have a scenario that I need to address.  The Level9Y column is a char field.  In the QVD, there are some cases where Level9Y is null but the percentage is not.  I am trying to not place a value in the percentage9 column if Level9y is null.  FYI..The len(trim approach seems to work best versus an isnull in other scripts that we have written.

I cannot find an example in the Qlik help that explains the parameters in detail for this scenario.

Thank you in advance.

LOAD  Level1 AS HProperty,
EffectiveDate,
APPLYMAP('MAP_Yardi',Level9) AS Level9Y,
if(LEN(TRIM(Level9Y)) > 0,' ') Percentage9, 

If have also tried:

if(LEN(TRIM(Level9Y)) > 0,Level9Y') Percentage9,  and

if(LEN(TRIM(Level9Y)) > 0,'Percentage9 ') as Percentage9, 

Labels (1)
1 Reply
Anonymous
Not applicable

you are creating the field Level9Y and you Access it right away.

you Need to use a preceding load

load *,

if(LEN(TRIM(Level9Y)) > 0,' ') Percentage9;

load

Level1 AS HProperty,
EffectiveDate,
APPLYMAP('MAP_Yardi',Level9) AS Level9Y,

...