Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
mhmmd_srf
Creator II
Creator II

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).

Please help.


Thanks,

Sarif

1 Solution

Accepted Solutions
swuehl
MVP
MVP

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)

View solution in original post

6 Replies
sunny_talwar

May be like this:

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

mhmmd_srf
Creator II
Creator II
Author

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

Thanks,

Sarif

sunny_talwar

Sure thing

mhmmd_srf
Creator II
Creator II
Author

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:

LOAD max(Z_DATE) as 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:

LOAD * INLINE

[

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

mhmmd_srf
Creator II
Creator II
Author

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

swuehl
MVP
MVP

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)