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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
nskatzis
Contributor III
Contributor III

Cannot handle null values

Hello,

I have the following Load statement

rootValue.Current_Phase:
Load ProjectId_New as projectsId
Resident rootValueNew
where projectFieldId_New = 1;
left join
Load projectsId, [Current Phase]
Resident "rootValue.Current Phase";

It produces the attached result set:

I want to change the Null value to something else.

I replaced [Current Phase] in my script with all the possible combinations I could think of, such as:

if (IsNull([Current Phase] or len(trim([Current Phase]))< 2 or [Current Phase]='NULL' or [Current Phase]='' or [Current Phase]='-'), '0. No Phase', [Current Phase]) as [Current_Phase]

or the opposite
if (NOT IsNull([Current Phase] or len(trim([Current Phase]))<> 0), [Current Phase], '0. No Phase') as [Current_Phase]

But nothing.

Current_Phase is shown as '-'

I even displayed len(trim([Current Phase])). It is shown as '-'

Can you help?

Thank you,

Nikos

Labels (1)
1 Solution

Accepted Solutions
BrunPierre
Partner - Master II
Partner - Master II

Instead of joining in this way, use mapping.

MapCurrentPhase:
Mapping Load projectsId,
[Current Phase]
Resident "rootValue.Current Phase";

Load ProjectId_New as projectsId, 
ApplyMap('MapCurrentPhase',ProjectId_New,'0. No Phase') as [Current Phase]
Resident rootValueNew;

View solution in original post

4 Replies
BrunPierre
Partner - Master II
Partner - Master II

Hi,

With NullAsValue statement as below.

NullAsValue [Current Phase] ;
Set NullValue = 'No Phase';

//----- Here's where your load statement goes -----\\
LOAD ...
nskatzis
Contributor III
Contributor III
Author

Hello,

Thank you for your reply but

Unfortunately it didn't work.

This is my script:

NullAsValue [Current Phase];
Set NullValue = '0. No Phase';
NoConcatenate


// The below is done in order to include projects with No 'Current Phase -- N.S
rootValue.Current_Phase:

Load ProjectId_New as projectsId /*, Value_New as Value_New2 */
Resident rootValueNew
where projectFieldId_New = 1;
left join
Load projectsId, [Current Phase]
Resident "rootValue.Current Phase";

BrunPierre
Partner - Master II
Partner - Master II

Instead of joining in this way, use mapping.

MapCurrentPhase:
Mapping Load projectsId,
[Current Phase]
Resident "rootValue.Current Phase";

Load ProjectId_New as projectsId, 
ApplyMap('MapCurrentPhase',ProjectId_New,'0. No Phase') as [Current Phase]
Resident rootValueNew;
nskatzis
Contributor III
Contributor III
Author

That worked!!!

Thank you very much!

Nikos