Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

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
erich_shiino
Honored Contributor

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

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.

5 Replies
Not applicable

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

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

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

Hi,

try this:

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

Hope this helps

Regards



erich_shiino
Honored Contributor

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

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

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

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

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

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!

Community Browser