Skip to main content
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

Hello,

  try this:

count({$ <date = {'xyz'} >} sales)

where xyz is the date you desire; you need to insert xyz in the right format according to your source data (do some test).

Regards,

Daniele

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try this

count({$ <date = {'$(=Today())'} >} sales)

It gets the count of Sales for current date.

Regards,

Jagan.

SunilChauhan
Champion
Champion

count({<date={'today','quarter to date'}>} sales)

hope this helps

Sunil Chauhan
Not applicable
Author

Hi all,

In the syntax mentioned, should i use the date as such or i should change it as per my database?

eg, if it is dt, should i change the expression to

count({<dt={'today','quarter to date'}>} sales)

Not applicable
Author

Hi,

If I use this expression

count({$<dt={'$03/28/2012'}>} SURGEON)

it counts the total no of values and not considering the date in the count.

Any corrections in the syntax?

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Try with this

     count({$<dt-={'03/28/2012'}>} SURGEON) it excludes the date(03/28/2012) given.

Celambarasan

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     you can use this for your requirement

    

count({<dt={">=$(QuarterStart(Today()))<=$(Today())"}>} SURGEON)

Celambarasan

Not applicable
Author

celambarasan,

It gives the total count and doesnt includes the condition in set analysis. Anything we are missing?

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Try with distinct

    

count({<dt={">=$(QuarterStart(Today()))<=$(Today())"}>} Distinct SURGEON)

Celambarasan