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: 
Not applicable

Creating Feilds

I have the following code :

qualify *;
unqualify [Incident ID], WO_Filter;

Workorders_Table:
LOAD [Incident ID],
     [Owned by Group],
     [WO Number],
     'Has WO' as WO_Filter
    
    
FROM
$(FactPath)BI_Workorders.QVD
(qvd);

Which creates a feild WO_Filter which has the option of 'Has WO'

How would i change this so that the WO_Filter has the option of 'Has WO' and 'Has not WO' ???

BWSBpJ3yqualify *;
unqualify [Incident ID], WO_Filter;

Workorders_Table:
LOAD [Incident ID],
     [Owned by Group],
     [WO Number],
     'Has WO' as WO_Filter
    
    
FROM
$(FactPath)BI_Workorders.QVD
(qvd);
qualify *;
unqualify [Incident ID], WO_Filter;

Workorders_Table:
LOAD [Incident ID],
     [Owned by Group],
     [WO Number],
     'Has WO' as WO_Filter
    
    
FROM
$(FactPath)BI_Workorders.QVD
(qvd);


1 Solution

Accepted Solutions
Jason_Michaelides
Luminary Alumni
Luminary Alumni

Slight typo - sorry!

IF(IsNull([WO Number]),'Has not WO','Has WO') as WO_Filter

View solution in original post

14 Replies
Jason_Michaelides
Luminary Alumni
Luminary Alumni

Not sure I understand correctly, but you could try:

Workorders_Table:

LOAD

     [Incident ID],

     [Owned by Group],

     [WO Number],

     IF(IsNull([WO Number],'Has not WO','Has WO') as WO_Filter

    

    

FROM

$(FactPath)BI_Workorders.QVD

(qvd);

Hope this helps,

Jason

Not applicable
Author

it comes up with an error on the line :

IF(IsNull([WO Number] 'Has not WO','Has WO') as WO_Filter

where the brackets don't equal but also the ' , ' is flagged red ???

Jason_Michaelides
Luminary Alumni
Luminary Alumni

Slight typo - sorry!

IF(IsNull([WO Number]),'Has not WO','Has WO') as WO_Filter

Not applicable
Author

ok thanks this works but the same as the code which i sent,

it still only gives one option so that the WO_Filter you can only select 'Has WO' :S ?

Jason_Michaelides
Luminary Alumni
Luminary Alumni

So when and why do you want 'Has not WO'?

Not applicable
Author

i want the option of having the WO_Filter to have to options which are ' Has WO ' and 'No WO' so that the information can be filtered accordinaly

magavi_framsteg
Partner - Creator III
Partner - Creator III

Hi.

Then it might just be so, that all rows in your data source indeed does have [WO Number] != null?

Kind regards

Magnus Åvitsland

BI Consultant

Framsteg Business Intelligence Corp.

Jason_Michaelides
Luminary Alumni
Luminary Alumni

As Magnus has said - my code checks for a [WO Number] and where there is one returns 'Has WO' otherwise it returns 'Has not WO'.  Should the logic be checking something different?

magavi_framsteg
Partner - Creator III
Partner - Creator III

Hi.

There are no rows without WO Nbr, is there?

You will only get to the else part of the if statement IF, and only if, the row has no WO Nbr.