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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
avishaiz
Contributor III
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
Master III
Master III

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

View solution in original post

3 Replies
antoniotiman
Master III
Master III

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
Contributor III
Contributor III
Author

Thank you

i feel a little

antoniotiman
Master III
Master III

Don't worry,no problem.

Regards,

Antonio