Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
its_anandrjs

Minutes average calculation problem

Hi All,

I want to calculate minutes Avg duration of call Ids, but problem occurs that there are same minutes value values for the different call ids so how can i sum it like for call

ID01 - 26.03

ID02 - 21.37

ID03 - 26.03

......

And so far there are so many ids that has repeted values but when i apply Distinct then it count as single value but it is repeated so many times for the IDs.

For Feb i calculate there are right now three ids

and sum is

26.03 + 21.37 + 26.03 = 99.46

Sum of Mins = 99.46

Count of Calls = 3

99.46 / 3 = 33.15

Any suggestion will appreciated

Please help for that.

Regards,

Anand

19 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Try Total instead of all.

Regards,

Kaushik Solanki

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

Hi,

I tried Total but not proper result.

Regards,

Anand

jedgson
Creator
Creator

Anand,

COuld you confirm that what you are tryig to achieve is an average of minutes for each distinct combination of [Call ID] & [Minutes]?

I think the easiest way to do this is create a new table in the script.

DistinctCominations:

Load

     Date as DC_Date,

     [Call ID] as DC_CallID,

     Minutes,

     Sum(1) as DC_Temp

Resident Directory

Group By Date, [Call ID];

You can then use this in a chart with an expression like Count(DC_CallID)/Sum(Minutes)

    

Jay

its_anandrjs
Author

Hi Jay,

Yes i want to calculate the average of minutes of callid.

Regards,

Anand

jedgson
Creator
Creator

Anand,

Did my sugestion give you the desired result?

Jay

swuehl
MVP
MVP

Hi all,

its.anandrjs schrieb:

Hi kaushik,

Yes i do this Sum(Min) /Count(ID) but wrong result see attachment please

Also when i has first 3 IDs Data

ID01 - 26.03

ID02 - 21.37

ID03 - 26.03

Result will be this:--

26.03 + 21.37 + 26.03 = 99.46

I get a different sum = 73.43

Sum of Mins = 99.46 73.43

Count of Calls = 3

99.46 / 3 = 33.15 24.48

But problem is that for ID01 26.03 repeated 20 times and and also if i sum by Sum(DIstinct Minutes) it counts only 26.03, 21.37 how i manage the ID03 - 26.03 also.


try

=Sum(aggr(DISTINCT Minutes,[Call ID]))/count(distinct [Call ID])

its_anandrjs
Author

Hi,

No it still gives error can please do changes in my sample file.

Regards,

Anand

swuehl
MVP
MVP

Please find my solution attached

Regards,

Stefan

narband2778
Creator II
Creator II

Hi Anand,

Did you find any solution.

If yes can you post it that would be much appreciated.


Thanks,

Naresh Bandari

effinty2112
Master
Master

Hi Anand,

=Sum(Minutes) / Count(DISTINCT Ques)/Count(DISTINCT [Call ID])

gives 24.477777777778