Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
chandra63
Creator
Creator

Average Calculation

Hi ,

Hope all Doing well.

I am Trying to calculate Avg in straight table with two dates.

we have fields:

1.installment_date

2.Installment_Number

3.OD_Details:- OD,Recovered.Non_OD

4.customer

5.Mortgage

based on the fields we want calculate Average like below

  • avg_gap_bet_od_0

Average gap between two OD instances is 0 months

  • avg_gap_btw_rec_0

Average gap between two recoveries is 0 month

  • avg_gap_btw_rec_7_12

Average gap between two recoveries instances is between 7 and 12 months

  • avg_gap_btw_rec_4_6

Average gap between two recoveries instances is between 4 and 6 months

  • avg_gap_bet_od_rec_1_3

Average gap between OD and its recovery is between 1 and 3 months



Average gap between OD

  • § Arrange all line wise entries of a contract, mortgage id for OD_detail=OD or OD_detail=recovered entries (i.e. only excluding Not OD entries) in ascending order of installment due date
  • § Find out difference between 2 consecutive entries in days
  • § Take average of the days and convert into months

1-Jun-17

0

1-Jul-17

30

1-Sep-17

62

1-Dec-17

91

Average

  1. 45.75

Months

  1. 1.525

Ex:

how i can get this Avg in expressions .

Please do needful.its help me more

Thanks in Advance.

chandra

2 Replies
sunny_talwar

Might be easy to help if you can share a sample and explain what you need to see as the expected output.
chandra63
Creator
Creator
Author

Hi Sunny,

please refer the excel file.

In that we got all expressions except the highlighted column(Green Colour).

 

please refer this link

https://community.qlik.com/t5/New-to-QlikView/variables-creation/m-p/95395#M23630

 

Thanks.