Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to calculate the outstanding count month by month

I have the following set of samlpe data and should like to calculate the outstanding un-settled invoice month by month.

Data
Invoice NumberIssue DateSettle Date
A011-Jan-1230-Apr-12
A021-Jan-1231-May-12
A031-Jan-1231-Mar-12
A041-Jan-1231-Aug-12
A051-Jan-1231-Jan-12
A061-Mar-1231-Mar-12
A071-Apr-1231-Aug-12
A081-May-1231-Aug-12
A091-May-121-Sep-12
A101-Jun-1231-Dec-12

The result that I am looking for is as below:

Output
SummaryOustanding Invoice Count
2012Jan5
2012Feb4
2012Mar5
2012Apr4
2012May5
2012Jun5
2012Jul5
2012Aug5
2012Sep2
2012Oct1
2012Nov1
2012Dec1

Anyone have any idea how to achieve this if I would like to calculate this on the chart object level instead of pre-calculate at the script level ?

Thanks in advance.

Cheers

H

6 Replies
Not applicable
Author

Hi

my reckon is you could use the  Intervalmatch function.

I'm not familiar with it but i think it could fit your needs

best regards

Chris

Not applicable
Author

Thanks for your reply.

But each record will need to be used several times based on the output dimension value.

For example, in my case, the invoice A01 needs to be included in the count when the dimension of output is 2012Jan, 2012Feb, 2012Mar and 2012Apr.

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Have a look at the attached application.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Hi Kaushik,

    Thanks for your sample file. I understand this solution but I don't want to expand my data table as I am having like 3M of transaction records. If using this way, my maindata table will be like havingt more than 6M records.

Can this type of calculation being done by using expression in the chart objects?

Thanks a lot

Cheers

H

Gysbert_Wassenaar

If you're going to try this with chart expressions it's likely going to be painfully slow. And 3 or 6 million records should be any problem for Qlikview.

I'd try it this way:

Data:

Load [Invoice Number],Date(Date#([Issue Date],'DD-MMM-YY')) as [Issue Date],Date(Date#([Settle Date],'DD-MMM-YY')) as [Settle Date] inline [

Invoice Number, Issue Date, Settle Date

A01, 1-Jan-12, 30-Apr-12

A02, 1-Jan-12, 31-May-12

A03, 1-Jan-12, 31-Mar-12

A04, 1-Jan-12, 31-Aug-12

A05, 1-Jan-12, 31-Jan-12

A06, 1-Mar-12, 31-Mar-12

A07, 1-Apr-12, 31-Aug-12

A08, 1-May-12, 31-Aug-12

A09, 1-May-12, 1-Sep-12

A10, 1-Jun-12, 31-Dec-12

];

Result:

load [Invoice Number], date(addmonths([Issue Date],IterNo()-1)) as Month

Resident Data

while addmonths([Issue Date],IterNo()-1) < [Settle Date]; // or maybe <= instead of <

If necessary you can calculate the counts too in the script.

Summary:

load Month, count([Invoice Number]) as InvoiceCount

resident Result

group by Month;

drop table Result;


talk is cheap, supply exceeds demand
Not applicable
Author


Thanks Gysbert. I understand what you mean.

Let me see what can I do.

The reason that we would like to calculate this on the chart is because we don't want to make any changes on top of the existing data model.

Thanks all again!