Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Syntax error on where clause why ?


Sprvsr:
LOAD   EMPL_GROUP_DESC as [SprvsrName],
    EMPL_GROUP_CD as [SprvsrID];
   
SQL SELECT *
FROM [DELTEKTE].[TC_0012].[EMPL_GROUP];

LEFT JOIN (Sprvsr)
LOAD   EMPL_ID as [TE_Employee_ID],
    EMPL_GROUP_CD  as [SprvsrID];
   
SQL SELECT *
FROM [DELTEKTE].[TC_0012].[EMPL_GROUP_EMPL]
WHERE MATCH (left[EMPL_GROUP_CD], 1)= 'M';

1 Solution

Accepted Solutions
Miguel_Angel_Baeyens

Hi,

Use the Match() function in the LOAD part. Match() is a QlikView function, not a standard SQL function. This should work (check parentheses):

LOAD   EMPL_ID as [TE_Employee_ID],

    EMPL_GROUP_CD  as [SprvsrID]

WHERE MATCH(Left([EMPL_GROUP_CD], 1) = 'M'

;

SQL SELECT *

FROM [DELTEKTE].[TC_0012].[EMPL_GROUP_EMPL]

;

Although you are using two functions instead of one for the same purpose, so you can either use WildMatch() or even better, just Left() in the same position as the previous.

WHERE LEFT([EMPL_GROUP_CD], 1) = 'M'

or

WHERE WILDMATCH([EMPL_GROUP_CD], 'M*')

or

WHERE [EMPL_GROUP_CD] LIKE 'M*'

Hope that helps.

Miguel

View solution in original post

3 Replies
swuehl
MVP
MVP

Try

..

WHERE MATCH ( left([EMPL_GROUP_CD], 1), 'M');

or

WHERE  left( [EMPL_GROUP_CD], 1) = 'M';

Anonymous
Not applicable
Author

Hello Swuehl,

I got this error message

Miguel_Angel_Baeyens

Hi,

Use the Match() function in the LOAD part. Match() is a QlikView function, not a standard SQL function. This should work (check parentheses):

LOAD   EMPL_ID as [TE_Employee_ID],

    EMPL_GROUP_CD  as [SprvsrID]

WHERE MATCH(Left([EMPL_GROUP_CD], 1) = 'M'

;

SQL SELECT *

FROM [DELTEKTE].[TC_0012].[EMPL_GROUP_EMPL]

;

Although you are using two functions instead of one for the same purpose, so you can either use WildMatch() or even better, just Left() in the same position as the previous.

WHERE LEFT([EMPL_GROUP_CD], 1) = 'M'

or

WHERE WILDMATCH([EMPL_GROUP_CD], 'M*')

or

WHERE [EMPL_GROUP_CD] LIKE 'M*'

Hope that helps.

Miguel