Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
jordigonz
Contributor

Where statement in Direct Discovery

Hi,

I'm testing Direct Discovery and I'm trying to use 'WHERE' statement in my Direct Query but it doesn't work.

I have a date field and I want to obtain only the data that belongs to year 2014. So I did that:

DIRECT QUERY

   DIMENSION

       Customer,

       Date,

       Salesman,

       Shop

       NATIVE('CAST (EAN as nvarchar(30))') as EAN

  MEASURE

   UDS,

   Amount

   FROM GRP.dbo.Sales

   WHERE Year(Date) = 2014;

I tried to use NATIVE statement: WHERE NATIVE('Year(Date)') = 2014; without success.


I found a workaround WHERE Date >= '01/01/2014' and Date <= '31/12/2014' but I'm interested to do it with qlik functions.

Some help?

Thanks

1 Solution

Accepted Solutions

Re: Where statement in Direct Discovery

Keep in mind that the DIRECT QUERY statement is in essence a SQL SELECT statement that needs to be performed on the database. For this reason, it can't possibly use Qlik functions like Year() - you have to stay within the SQL syntax.

3 Replies
agomes1971
Valued Contributor

Re: Where statement in Direct Discovery

Hi,

see this thread

http://community.qlik.com/thread/111959

HTH

André Gomes

Re: Where statement in Direct Discovery

Keep in mind that the DIRECT QUERY statement is in essence a SQL SELECT statement that needs to be performed on the database. For this reason, it can't possibly use Qlik functions like Year() - you have to stay within the SQL syntax.

jordigonz
Contributor

Re: Where statement in Direct Discovery

Thank to both of you for your answers.

Community Browser