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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Syntax for including a date field in a expression

Hi,

I want to write a expression which counts for a particular day,

for eg. count(sales) , in which i need a include a where condition as date like count(sales) where date = 'today' or date = 'quarter to date"

I need to know the syntax for the same.

Help required on a urgent basis.

15 Replies
Not applicable
Author

celambarasan,

count({$<dt-={'03/28/2012'}>} SURGEON) , even this gives the total count.  my dt field in database is in varchar format, is that  creating a problem to us?


Not applicable
Author

Still  i use a distinct function, it gives only the total count and not for the particular date

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Yes.you have to format the date while loading the table from the database.like Date(Date#(Field,Format))

     Format is in what format the field in database has may be like 'DD/MM/YYYY'

Celambarasan

Not applicable
Author

hi,

I use a sql statement like select * from table1;

now how to include the above said statement? either in sql format or i need to follow the syntax as qlik view format.

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Yes you can apply precede load to it like

     Load

          Field1,

          Field2,

          Date(Date#(Field,Format)) as dateField;

      select * from table1;

Celambarasan

Not applicable
Author

super cool!!!awesome!!! it works.