Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
sajad_manzoor
Partner - Contributor III
Partner - Contributor III

Mapping Null values not working

Hi,

I have following code:

//===========================================================================

TimeSheet:

SQL  SELECT

    "Entry No_",

    "Activity Code",

    "Consultant Code",

     EVPM,

    isNull("Man Days",0) as "Project ManDays",

     Month,

    "Working Date",

    "Project Code",

     Year

FROM ProjectManagement.dbo."PROJECT MANAGEMENT$Time Sheet Entry";

//=====================================================================================

ManDays:

SQL SELECT

    SUM("Man Days") as ManDays,

    Month,

    Year,

   "Consultant Code" 

FROM ProjectManagement.dbo."PROJECT MANAGEMENT$Time Sheet Entry"

Group By

      Month,

      Year,

     "Consultant Code";

    

//===============================================================================

Map_Nulls:

Mapping LOAD

Null(), '000' AutoGenerate ;

 

MAP EVPM USING Map_Nulls;

TimeSheet2:

NoConcatenate 

LOAD * RESIDENT TimeSheet;

DROP TABLE TimeSheet; 

I want to remove null values in EVPM,

But the above null mapping does not work at all,

please suggest 

20 Replies
rbecher
MVP
MVP

NLV is am Oracle function. This query more looks like SQL Server..

Astrato.io Head of R&D
sajad_manzoor
Partner - Contributor III
Partner - Contributor III
Author

This is the screen short , problem still not resolved:

SS.png

Not applicable

When loading, format EVPM as a number:

num(EVPM)

Maybe the problem is that it's loaded as a String...

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     You can try this.

     NullAsValue A,B;

     Set NullValue = 'NULL' ;

     Load A,B from x.csv;

     This setting will replace the null values to the values.

Regards,

Kaushik Solnaki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
sajad_manzoor
Partner - Contributor III
Partner - Contributor III
Author

the datatype of EVPM is decimal

sajad_manzoor
Partner - Contributor III
Partner - Contributor III
Author

IOSU,

i changed my code to

TimeSheet:

LOAD

    "Entry No_",

    "Activity Code",

    "Consultant Code",

    IF(isNull(NUM( EVPM)),0,NUM(EVPM)) as EVPM,

    "Man Days" as "Project ManDays",

     Month,

    "Working Date",

    "Project Code",

     Year;

    

  SQL Select *

FROM ProjectManagement.dbo."PROJECT MANAGEMENT$Time Sheet Entry";

But i still have null values in EVPM

sajad_manzoor
Partner - Contributor III
Partner - Contributor III
Author

Hello Kaushik,

If u can explain how to use NullAsValue with my code:

TimeSheet:

LOAD

    "Entry No_",

    "Activity Code",

    "Consultant Code",

    IF(isNull(NUM( EVPM)),0,NUM(EVPM)) as EVPM,

    "Man Days" as "Project ManDays",

     Month,

    "Working Date",

    "Project Code",

     Year;

   

  SQL Select *

FROM ProjectManagement.dbo."PROJECT MANAGEMENT$Time Sheet Entry";

sajad_manzoor
Partner - Contributor III
Partner - Contributor III
Author

Ya , that is why i used isNULL() of sql server.

but all in vain ;-(

rbecher
MVP
MVP

Maybe, because of decimal use:

ISNULL(EVPM, 0.0) as "EVPM"

..or

COALESCE(EVPM, 0) as "EVPM"

Astrato.io Head of R&D
CELAMBARASAN
Partner - Champion
Partner - Champion

I feel that problem happening your data is not because of null.

It looks like its in string format

try converting it to number format with this

IF(isNull(EVPM) or Len(Trim(EVPM)) = 0, 0, Num(Num#(EVPM, '#,###.##'))) as EVPM,


Hope this helps