Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
dmxmikey
Creator
Creator

where clause

I need to output N where   [alg-stat] is blank and below is my script

Allergens_Data:

NoConcatenate load

upper([p-code]) as [p-code], //Upper done in products table

[p-split1] //Parent product code

Resident Products

where [p-split]=1;

//Join on split product allergen data based on parent product code

left join (Allergens_Data)

load

upper([p-code]) as [p-split1], //Parent product code

    [alg-code],

    [qual-code],

    [alg-stat] Where [alg-stat]='','N'

FROM

***

2 Replies
felipedl
Partner - Specialist III
Partner - Specialist III

Hi Mike,

Use something like:

//Join on split product allergen data based on parent product code

left join (Allergens_Data)

load

upper([p-code]) as [p-split1], //Parent product code

    [alg-code],

    [qual-code],

    [alg-stat]

FROM [ Whatever]

Where len([alg-stat])=0 or [alg-stat]='N';

sunny_talwar

May be this

Allergens_Data:

NoConcatenate

LOAD upper([p-code]) as [p-code], //Upper done in products table

    [p-split1] //Parent product code

Resident Products

Where [p-split]=1;

//Join on split product allergen data based on parent product code

left join (Allergens_Data)

load Upper([p-code]) as [p-split1], //Parent product code

    [alg-code],

    [qual-code],

    [alg-stat]

FROM

***;

Final_Allergens_Data:

LOAD *,

    If(Len(Trim([alg-stat])) = 0, 'N', [alg-stat]) as [New-alg-stat]

Resident Allergens_Data;

DROP Table Allergens_Data;

DROP FIELD [alg-stat] FROM Final_Allergens_Data;

RENAME FIELD  [New-alg-stat] to  [alg-stat];