Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
mhmmd_srf
Not applicable

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
Not applicable

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)

6 Replies
sunny_talwar
Not applicable

Re: How to find out count of Mathing records

May be like this:

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

mhmmd_srf
Not applicable

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

sunny_talwar
Not applicable

Re: How to find out count of Mathing records

Sure thing

mhmmd_srf
Not applicable

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:

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
Not applicable

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

swuehl
Not applicable

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)