Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

msawyercke
New Contributor III

'Count' question

Hi,

I'm trying to count distinct records that fall within a date range.

So, I have the following 3 variables:

  • PS# (which is a unique store identifier)
  • Today's Date
  • Opening Date

I can calculate 'Days To Open' with the formula ([Opening Date]-Today()), and since some PS#'s have already opened, the "Days To Open' field can be a negative number.

What I want to do is count the number of unopened "PS#" that will open within the next 30 days.  That is, 'Days To Open' is greater than 0, but less than 31.

What is the proper Count function expression to do this?

Thanks! 

1 Solution

Accepted Solutions

Re: 'Count' question

May be like this:

Count(DISTINCT {<[PS#] = {"=[Opening Date]-Today() > 0 and [Opening Date]-Today() < 31"}>} [PS#])

2 Replies

Re: 'Count' question

May be like this:

Count(DISTINCT {<[PS#] = {"=[Opening Date]-Today() > 0 and [Opening Date]-Today() < 31"}>} [PS#])

msawyercke
New Contributor III

Re: 'Count' question

Thanks, Sunni.  This worked perfectly!  The syntax requirements for these formulas are so difficult for me. 

Community Browser