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

Set Analysis to count the customer from SysDate to next 14 days!

Hi All

Can some one help me out to write the Set Analysis for couting the number customer of from CurrentDate(SystemDate) to next 14 days? Imagine that the date field is StartDate.

Please add Set Analysis with the below code:


Count(CustomerID)
<pre></body>
1 Solution

Accepted Solutions
erichshiino
Partner - Master
Partner - Master

Do you need only the date 14 days in the future? or all the dates until then?

You can try:

count({$<StartDate={'>=$(=date(today()))<=$(=date(today()+14))'}>} CustomerID)

Set analysis syntax may not handle data formats very well... If the expression above does not work, you should make a number field and use the following expression:

count({$<nStartDate={'>=$(=num(today()))<=$(=num(today()+14))'}>} CustomerID)

and nStartDate would be =num(StartDate) inyour load script.

View solution in original post

5 Replies
Not applicable
Author

Hi

I tried something like below but it didn't work. Could you please suggest me correct way of doing it please.



Count({$<StartDate={$(=today()+14)}>} CustomerID)



Not applicable
Author

Hi,

try this:

count({$<StartDate={'$(=date(today()+14))'}>} CustomerID)

Hope this helps

Regards



erichshiino
Partner - Master
Partner - Master

Do you need only the date 14 days in the future? or all the dates until then?

You can try:

count({$<StartDate={'>=$(=date(today()))<=$(=date(today()+14))'}>} CustomerID)

Set analysis syntax may not handle data formats very well... If the expression above does not work, you should make a number field and use the following expression:

count({$<nStartDate={'>=$(=num(today()))<=$(=num(today()+14))'}>} CustomerID)

and nStartDate would be =num(StartDate) inyour load script.

Not applicable
Author

Hi Gabriela

Thanks alot for your time and help! I want to count the number of customers from todays date to till next 14 days. Your Set Analysis works only for 14th day from todays date.

Solution given Erich Shiino works fine as per my above request. It gives the count of customer from todays date to next 14 days.

Not applicable
Author

Hi Erich Shiino

Many thanks for your help. Your understanding is correct! I wanted the count of customers for all the dates until 14th day from todays date. As of now I think it is working without changing it to the date field. If there is any problem lateron and I couldn't solve it then in that case I will let you know.

Thanks once again!