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: 
krmvacar
Creator II
Creator II

Avg total by dımensıon

Hi all,

I have a table and I want to calculate the average value in this table. I want to print all rows with the average value I calculated. But it didn't work. Your help is welcome.

Avg total time measure my calculation:

AVG(TOTAL  AGGR(Sum(total tıme)/count(DISTINCT ordernumber),Prodnumber))

Prodnumber ordernumber total tıme Avg total time
401000180 21022916 375,00 117,47
401000180 21022915 375,00 117,47
401000180 21022049 305,00 117,47
401000180 20062180 295,00 117,47
401000180 21022051 226,00 117,47
401000180 20102272 226,00 117,47
401000180 20090291 214,00 117,47
401000180 20080483 214,00 117,47
401000180 20102274 205,00 117,47
401000180 20102273 205,00 117,47
401000180 20091306 205,00 117,47
401000180 21012073 185,00 117,47
401000180 20071014 185,00 117,47
401000180 21072954 151,00 117,47
401000180 21080772 140,00 117,47
401000180 21072201 135,00 117,47
402000076 20112586 79,00 117,47
402000076 20112585 79,00 117,47
402000076 20112584 79,00 117,47
402000076 20112587 78,00 117,47
402000076 20112583 78,00 117,47
402000076 20112582 78,00 117,47
401000045 21050225 74,00 117,47
401000045 21070020 69,00 117,47
401000045 21060094 69,00 117,47
401000045 20120967 51,00 117,47
401000045 21010464 50,00 117,47
401000045 21101558 48,00 117,47
401000045 21092426 48,00 117,47
401000045 21111571 47,00 117,47
401000045 21111570 47,00 117,47
401000045 21051578 39,00 117,47
401000045 21060580 36,00 117,47
401000045 21111325 29,00 117,47
401000045 21092425 21,00 117,47
401000045 21092422 21,00 117,47

 

 

I want to result :

 

Prodnumber ordernumber total tıme Avg total time
Totals     132,25
401000180 21022916 375,00 227,56
401000180 21022915 375,00 227,56
401000180 21022049 305,00 227,56
401000180 20062180 295,00 227,56
401000180 21022051 226,00 227,56
401000180 20102272 226,00 227,56
401000180 20090291 214,00 227,56
401000180 20080483 214,00 227,56
401000180 20102274 205,00 227,56
401000180 20102273 205,00 227,56
401000180 20091306 205,00 227,56
401000180 21012073 185,00 227,56
401000180 20071014 185,00 227,56
401000180 21072954 151,00 227,56
401000180 21080772 140,00 227,56
401000180 21072201 135,00 227,56
402000076 20112586 79,00 78,50
402000076 20112585 79,00 78,50
402000076 20112584 79,00 78,50
402000076 20112587 78,00 78,50
402000076 20112583 78,00 78,50
402000076 20112582 78,00 78,50
401000045 21050225 74,00 46,36
401000045 21070020 69,00 46,36
401000045 21060094 69,00 46,36
401000045 20120967 51,00 46,36
401000045 21010464 50,00 46,36
401000045 21101558 48,00 46,36
401000045 21092426 48,00 46,36
401000045 21111571 47,00 46,36
401000045 21111570 47,00 46,36
401000045 21051578 39,00 46,36
401000045 21060580 36,00 46,36
401000045 21111325 29,00 46,36
401000045 21092425 21,00 46,36
401000045 21092422 21,00 46,36

 

Best Regards,

 

Labels (4)
1 Solution

Accepted Solutions
MayilVahanan

Hi

Try like below

AVG(TOTAL<Prodnumber> AGGR(Sum([total tıme])/count(DISTINCT ordernumber),Prodnumber))

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

3 Replies
settu_periasamy
Master III
Master III

Hi,

Can you try this?

AVG(TOTAL <Prodnumber> [total tıme])

MayilVahanan

Hi

Try like below

AVG(TOTAL<Prodnumber> AGGR(Sum([total tıme])/count(DISTINCT ordernumber),Prodnumber))

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
krmvacar
Creator II
Creator II
Author

Hi @MayilVahanan 

Sorry to disturb you again.I'm adding a new column here and I'm getting an error. Can you help me?

I want to add Stdev to the average value we have calculated.

 

Can you help me?