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

How to take Average across data in a Column

Hi,

I have following data:

I created this table in QlikView. Duration and Maximum columns are in "hh:mm" format.

"Utilization" column = "Duration" divided by "Maximum" in percentage for each row.

Table1:

KeyDateDurationMaximumUtilization
106/26/20130:260:3672%
106/27/20132:5610:2628%
106/28/20132:309:3926%
206/26/20130:260:3672%
206/27/20132:5510:2628%
206/28/20131:409:3917%
306/26/20130:260:3672%
306/27/20131:4010:2616%
306/28/20132:059:3922%
406/26/20130:250:3669%
406/27/20131:4010:2616%
406/28/20131:409:3917%

I want to take the sum of column "Duration" for each "Key" across three dates and then divide the result by sum of all values in the "Maximum" column for each key across all dates.

The result must look like this:

Table2:

KeyDurationSumMaximumSumUtilizationSum
15:5220:4128.36%
25:0120:4124.25%
34:1120:4120.23%
43:4520:4118.13%

where "DurationSum" column is sum of first three rows from "Table1" for "Key 1" and "MaximumSum" is sum of first three rows for "Key 1" from "Table1". UtilizationSum is DurationSum divided by MaximumSum

How do I get Table2

I am surprised that I cannot get QlikView to do this either as an Expression in the Chart or in the Table. I tried average. I even tried creating a variable in the Load script.

Seems simple. Can someone please guide?

Thanks,

1 Solution

Accepted Solutions
hic
Former Employee
Former Employee

Make a chart with Key as dimension, and the following three expressions:

Sum(Duration)

Sum(Maximum)

Sum(Duration) / Sum(Maximum)

HIC

View solution in original post

2 Replies
hic
Former Employee
Former Employee

Make a chart with Key as dimension, and the following three expressions:

Sum(Duration)

Sum(Maximum)

Sum(Duration) / Sum(Maximum)

HIC

Not applicable
Author

Hi Henric,

Thanks for the quick response. I have used "Key" and "Date" as Dimensions

"Duration", "Maximum", and "Utilization" are Expressions.

I am currently using Duration = Interval(Sum(EndDate - StartDate),'hh:mm'). Maximum value is derived using a complicated expression. I did not use Sum(Maximum).

It worked.

Thanks,