Hi Guys, does any body can tell me why this Where condition is not working?? What I need is to get the sales of this month not before this month, I tryed this but is not working, any ideas?? I attached the APP for a better understand.
Your Where clause is part of a SQL SELECT statement. This statement is executed by the database server and not by the Qlikview script. Monthstart and Today are Qlikview operators that are not understood by the database server and so will not work here.
The normal solution is to put the dates into variables, and $ expand the variables to make a valid SQL Where clause.
Before the SQL Select, define the variables:
Let vToday = Date(Today(), 'YYYY-MM-DD');
Let vMonthStart = Date(MonthStart(Today(), 'YYYY-MM-DD');
... and in the Where clause:
Where DATE > '$(vMonthStart)' AND DATE <= '$(vToday)'
(Adjust the data format as required so that it matches the date formats for your database locale)