Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Buckets Calculation Giving Same values after calculation

Hi Community member,

I have written buckets calculation like this ,I got the buckets ,but I am getting same values of Recevable age when I am calculating.Can anyone help please.

Load *,if(Date('03/31/2008')-Date(InvoiceDate)=0,'Current',

If(Date('03/31/2008')-Date(InvoiceDate)<=30,'1-30 Days',

If(Date('03/31/2008')-Date(InvoiceDate,'MM/DD/YY')<=61,'31-60 Days',

If(Date('03/31/2008')-Date(InvoiceDate,'MM/DD/YY')<=91 ,'61-90 Days',

If(Date('03/31/2008')-Date(InvoiceDate,'MM/DD/YY')<=121,'91-120 Days',

If(Date('03/31/2008')-Date(InvoiceDate,'MM/DD/YY')<=151,'121-150 Days','Over 150 Days')))))) as ReceivablesAge;

LOAD * Inline

[

InvoiceDate

9/30/2000

10/31/2000

11/30/2000

12/29/2000

1/31/2001

2/28/2001

3/30/2001

4/30/2001

5/31/2001

6/30/2001

7/31/2001

8/31/2001

9/28/2001

10/31/2001

11/30/2001

12/31/2001

2/1/2002

2/28/2002

3/29/2002

4/30/2002

5/31/2002

6/30/2002

7/31/2002

8/30/2002

9/30/2002

10/31/2002

11/30/2002

1/2/2003

1/31/2003

2/28/2003

3/31/2003

4/30/2003

5/29/2003

6/30/2003

7/31/2003

8/31/2003

9/30/2003

10/30/2003

11/30/2003

12/31/2003

1/29/2004

2/2/2004

2/28/2004

3/31/2004

4/30/2004

5/31/2004

6/1/2004

6/30/2004

7/31/2004

8/31/2004

9/30/2004

10/29/2004

10/31/2004

11/30/2004

12/31/2004

1/31/2005

2/28/2005

3/31/2005

4/29/2005

5/31/2005

6/30/2005

7/29/2005

8/31/2005

9/30/2005

10/31/2005

11/30/2005

12/31/2005

1/31/2006

2/28/2006

3/31/2006

4/30/2006

5/31/2006

6/30/2006

7/31/2006

8/31/2006

9/29/2006

10/31/2006

11/30/2006

12/31/2006

1/31/2007

2/28/2007

3/29/2007

4/30/2007

5/31/2007

6/28/2007

7/31/2007

8/30/2007

9/27/2007

10/31/2007

11/29/2007

12/31/2007

1/31/2008

2/28/2008

3/31/2008

];

Regards

rams

1 Reply
whiteline
Master II
Master II

Hi.

I think you're using the wrong function to convert your dates from string to numbers.

Use Date#() instead.

The date() only changes the text format of a numerical date value.