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

Announcements
Meet Qlik's New CEO. The Future Is Bright — Here's What to Expect
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';

Labels (1)
1 Solution

Accepted Solutions
Miguel_Angel_Baeyens
Support
Support

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
Champion III
Champion III

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
Support
Support

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