Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

count of records for max date

Hi All,

I am trying to display the count of records in a text box.

My expression is

=COUNT({$<MER_MATCH_MASK={'1'},RUN_DATE={"=$(=vMaxDate)"}>}MTR_ID);

where vMaxDate=Max(Date)

but it just returns zero.

Thanks in advance,

Anju

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

  Hi Anju,

Try this

=Count({<Date={'$(vMaxDate)'}>} Date)

Make sure both date formats are same

Regards,

Jagan.

View solution in original post

9 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Add a date function:

=COUNT({$<MER_MATCH_MASK={'1'}, RUN_DATE={"=$(=Date(vMaxDate))"}>} MTR_ID);

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Hi Jonathan,

Thanks for replying.

But, it did not work.

jagan
Luminary Alumni
Luminary Alumni

  Hi Anju,

Try this

=Count({<Date={'$(vMaxDate)'}>} Date)

Make sure both date formats are same

Regards,

Jagan.

Not applicable
Author

Try this

 

=Count(If(Date=vMaxDate,D_Plant))

Where vMaxDate=Max({1}Date)

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Its possible that the format of RUN_DATE is not the default format for your environment (see the SET DateFormat statement at the top of your script). You need to format the vMaxDate value in same format as RUN_DATE.

For example, if RUN_DATE is in YYYY-MM-DD format, then use:

=COUNT({$<MER_MATCH_MASK={'1'}, RUN_DATE={"$(=Date(vMaxDate, 'YYYY-MM-DD'))"}>} MTR_ID);

Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
senpradip007
Specialist III
Specialist III

Hi Anju,

try this:

Count({$<Date = {'$(vMaxDate)'} >} MTR_ID)

where vMaxDate = Max(Date).

Make sure that both the date format should be same.

Not applicable
Author

Hi Jonathan,

This did not work either..

Not applicable
Author

Thanks, Jagan!

It worked !

My expression looks like this

=Count({<MER_MATCH_MASK={'2'},RUN_DATE={'$(vMaxDate)'}>} MTR_ID)

Not applicable
Author

Hi Rajkumar,

I wanted to use set analysis.

I was already aware of the if condition syntax.

Thank You..