3 Replies Latest reply: Feb 13, 2015 12:33 PM by Jordi Gonzalez RSS

    Where statement in Direct Discovery

    Jordi Gonzalez

      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