Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Average of no of days in partial sum

Hello All,  I am using Qlikview 11. I have a column to show Period Variance in Date1 and Date2 in Pivot table.  So I have written the expression as Date2 - Date1. This gives me correct no of days between the 2 dates.  But in the sub-total row, I want to show the average of all the no of days for a customer.  So how to write the expression for this?

5 Replies
Gysbert_Wassenaar

Try avg(Date2-Date1). That should work on both the row level and partial sums level. If not please post a sample document. See Preparing examples for Upload - Reduction and Data Scrambling


talk is cheap, supply exceeds demand
Not applicable
Author

Hi Gysbert,

I tried avg(date2-date1) but still it is not working.

I have created sample file for you.

Please check and let me know where it is going wrong.

Also I have Report for the period textbox where I display from date and to date which is created using master calender.

But when I do any more selections apart from calender fields, my from date and to date shows dates as per data available form DB and not from calender.

Please can you help me for this also.

Gysbert_Wassenaar

As far as I can tell the average works fine:

comm84879.png

I don't see a calendar object in your document. You make selections in fields. When you make selections in other fields that can influence those earlier selections. A contradicting selection in one field will clear the other fields.

edit: try these expressions:

Period Variance: avg(alt(DeliveryDate - RequiredDate,0))

Turnaround Time: avg(alt(DeliveryDate - OrderDate,0))


talk is cheap, supply exceeds demand
Not applicable
Author

Sorry did not give full information.  I need average for "Turn around time of order in No of days" (last column).  But also for Period Variance, I think it should be (66 + 0 - 1)/ 3 = 21.67  I have not used the calender object, but a master calender in script. I want my From date and to date to be dependent only on calender fields and  no other fields in the report.

Not applicable
Author

any help please.