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

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
bnelson111
Creator II
Creator II

Having Trouble Filling in Nulls

I have a left join table were 041 is the stat-code and the description should read 'deleted' as i want to replace the Null currently reading against the 041 code. But the table is coming up as pic see below script??

Script

left join

LOAD "stat-code",

if(len("stat-code")='041','deleted',description) as description,

    "type",

    cost,

    kco,

    movement,

    indirect,

    "trans-cost",

    "sundry-code",

    "restrict-flag",

    "sub-type",

    PlantCode;

SQL SELECT *

FROM PUB.sfstatcode;

Labels (1)
9 Replies
anbu1984
Master III
Master III

if(Trim("stat-code")='041','deleted',description) as description,

bnelson111
Creator II
Creator II
Author

unfortunately didn't work

left join

LOAD "stat-code",

if(Trim("stat-code")='041','deleted',description) as description,

//description,

    "type",

    cost,

    kco,

    movement,

    indirect,

    "trans-cost",

    "sundry-code",

    "restrict-flag",

    "sub-type",

    PlantCode;

SQL SELECT *

FROM PUB.sfstatcode;

//-------- End Multiple Select Statements ------

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

The length of a value will never be '041'. So you probably mean if("stat-code"='041', ...etc.

Is the field description part of the left table or of the PUB.sfstatcode? If that field only exists in the left table then you first have to join the tables before you can fill the nulls.


talk is cheap, supply exceeds demand
anbu1984
Master III
Master III

Is stat-code join key?

CELAMBARASAN
Partner - Champion
Partner - Champion

May be stat-code = 041 exists only in the first table, which you do left join with

If that is the case then use the below code

Lets say first loaded table is Table1(before the left join)

left join

LOAD "stat-code",

     description,

    "type",

    cost,

    kco,

    movement,

    indirect,

    "trans-cost",

    "sundry-code",

    "restrict-flag",

    "sub-type",

    PlantCode;

SQL SELECT *

FROM PUB.sfstatcode;

Left Join(Table1)

LOAD DISTINCT "stat-code",

     if(Trim("stat-code")='041','deleted',description) as NewFieldDescription

Resident Table1;

chrislofthouse
Partner Ambassador
Partner Ambassador

Try this:

if(Trim([stat-code])=041,'deleted',description) as description,

Or if you can upload the app this would help diagnose the problem quicker.

bnelson111
Creator II
Creator II
Author

Yes

bnelson111
Creator II
Creator II
Author

Heres the two tables

[SFDC DATA]:

LOAD kco,

    kjobcode,

    kcompno,

    "seq-code",

    "mach-id",

    "stat-code",

    "op-code",

    "start-time",

   Interval#( "elapse-time",'s') as "Seconds",

   "elapse-time",

    "shift-code",

    "extract-flag",

    "non-prod-flag",

    "seq-code2",

    "overtime-flag",

    kprocno,

    "history-flag",

    formno,

    "event-type",

    "substat-init",

    "substat-final",

    date(Date(Date('1990-01-01 00:00:00.000') +Num#("end-time"/86400)),'DD/MM/YYYY') as "End Date",

     day(date(Date(Date('1990-01-01 00:00:00.000') +Num#("end-time"/86400)),'DD/MM/YY')) AS "Day Completed",

     Month(date(Date(Date('1990-01-01 00:00:00.000') +Num#("end-time"/86400)),'DD/MM/YY')) AS "Month Completed",

      year(date(Date(Date('1990-01-01 00:00:00.000') +Num#("end-time"/86400)),'DD/MM/YY')) AS "Year Completed",

  

    amended,

    "ass-no",

    "group-code",

    "seq-num",

    "sub-type",

    "comment-flag",

    "group-ind",

    PlantCode,

    "event-qty",

    "misc-qty",

    "sundry-qty";

SQL SELECT *

FROM PUB.sfeventcds

WHERE "start-time" > '733682170';

left join

LOAD "stat-code",

description,

    "type",

    cost,

    kco,

    movement,

    indirect,

    "trans-cost",

    "sundry-code",

    "restrict-flag",

    "sub-type",

    PlantCode;

SQL SELECT *

FROM PUB.sfstatcode;

//-------- End Multiple Select Statements ------

anbu1984
Master III
Master III

As Celambarasan said below, you may not have 041 in PUB.sfstatcode. Try as he suggested below