Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
msawyercke
Creator
Creator

'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
sunny_talwar

May be like this:

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

View solution in original post

2 Replies
sunny_talwar

May be like this:

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

msawyercke
Creator
Creator
Author

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