6 Replies Latest reply: Jan 18, 2017 5:06 AM by Stefan Wühl

# How to find out count of Mathing records

HI All,

I have 3 dates for one particular selection.

I have another 4 dates depends on current dates.

I need to identify how may values from Dates field falls under Last 4 Week Days field.  I need that count. In the below example there is no matching values. So it should return Zero (0).

Thanks,

Sarif

• ###### Re: How to find out count of Mathing records

May be like this:

Count(DISTINCT {<Dates = p([Last 4 Week Days])>}Dates)

• ###### Re: How to find out count of Mathing records

I think it is working. Let me test properly and will let u know.

Thanks,

Sarif

• ###### Re: How to find out count of Mathing records

Sure thing

• ###### Re: How to find out count of Mathing records

Hi Sunny,

One problem is there in my App.

I am creating the Last 4 Week Day in the back end. Below is the script:

LASTDT:

RESIDENT ORD_VOL;

LET vDATE = Date(Date#(Peek('LASTDT',0,'LASTDT'),'YYYYMMDD'),'M/D/YYYY');

LET v_DT7_1 = Date(Date#('\$(vDATE)','M/D/YYYY') - 7);

LET v_DT14_1 = Date(Date#('\$(vDATE)','M/D/YYYY') - 14);

LET v_DT21_1 = Date(Date#('\$(vDATE)','M/D/YYYY') - 21);

LET v_DT28_1 = Date(Date#('\$(vDATE)','M/D/YYYY') - 28);

Last4Weekday:

[

Last4Weekday

'\$(v_DT7_1)',

'\$(v_DT14_1)',

'\$(v_DT21_1)',

'\$(v_DT28_1)'

];

But the we have an extension in front end for vDATE.

If I am selecting any other day from the extension, it is not reflecting in Last4Weekday table.

Is there any way to create this Last4Weekday table in front end?

Thanks,

Sarif

• ###### Re: How to find out count of Mathing records

I am trying to write the below script. But is not working:

Count( {\$<Dates = P({\$<Dates={'\$(vDATE)',Date(Date#('\$(vDATE)','M/D/YYYY') - 7)}>})>} Dates)

Thanks,

Sarif

• ###### Re: How to find out count of Mathing records

You could try something like

Count(DISTINCT

{<Dates = {"\$(=Date(Date#('\$(vDATE)','M/D/YYYY') - 7))","\$(=Date(Date#('\$(vDATE)','M/D/YYYY') - 14))","\$(=Date(Date#('\$(vDATE)','M/D/YYYY') - 21))","\$(=Date(Date#('\$(vDATE)','M/D/YYYY') - 28))"} >}

Dates)