Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
avishaiz
New Contributor III

Creating categories on load

hi

i'm trying to create categories in the load script

for some reason i keep getting an error message "item 'ITEMID' not found

here is the script:

LIB CONNECT TO [avi];

[PRODTABLE]:

LOAD ITEMID,

    PRODPOOLID;

SQL SELECT ITEMID,

    PRODPOOLID

FROM AXPROD.dbo.PRODTABLE;

[מאגרים]:

Load

IF(PRODPOOLID=20,'metal',

    if(PRODPOOLID=30,'plastic',

    if(PRODPOOLID=32,'flow',

    if(PRODPOOLID=33,'storm',

    if(PRODPOOLID=34,'regev',

    if(PRODPOOLID=60,'pilot',

    if(PRODPOOLID=20 and WildMatch(ITEMID,'5c*'),'valve', Null())))))))

    AS [categories];

   

     SQL SELECT "PRODPOOLID"

   

FROM "AXPROD"."dbo"."PRODTABLE";

thanks.

1 Solution

Accepted Solutions
antoniotiman
Honored Contributor III

Re: Creating categories on load

Hi Avishai,

You need to add ITEMID field in 2nd Select

Load

IF(PRODPOOLID=20,'metal',

    if(PRODPOOLID=30,'plastic',

    if(PRODPOOLID=32,'flow',

    if(PRODPOOLID=33,'storm',

    if(PRODPOOLID=34,'regev',

    if(PRODPOOLID=60,'pilot',

    if(PRODPOOLID=20 and WildMatch(ITEMID,'5c*'),'valve', Null())))))))

    AS [categories];

  

    SQL SELECT "PRODPOOLID",ITEMID

  

FROM "AXPROD"."dbo"."PRODTABLE";

Regards,

Antonio

3 Replies
antoniotiman
Honored Contributor III

Re: Creating categories on load

Hi Avishai,

You need to add ITEMID field in 2nd Select

Load

IF(PRODPOOLID=20,'metal',

    if(PRODPOOLID=30,'plastic',

    if(PRODPOOLID=32,'flow',

    if(PRODPOOLID=33,'storm',

    if(PRODPOOLID=34,'regev',

    if(PRODPOOLID=60,'pilot',

    if(PRODPOOLID=20 and WildMatch(ITEMID,'5c*'),'valve', Null())))))))

    AS [categories];

  

    SQL SELECT "PRODPOOLID",ITEMID

  

FROM "AXPROD"."dbo"."PRODTABLE";

Regards,

Antonio

avishaiz
New Contributor III

Re: Creating categories on load

Thank you

i feel a little

antoniotiman
Honored Contributor III

Re: Creating categories on load

Don't worry,no problem.

Regards,

Antonio

Community Browser