Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
davyqliks
Specialist
Specialist

Sum the Average Unit Price

Hi,

I am looking to find the Average value of dimension [Invoice Item Unit Price]

I am struggling to get the right result back, any advice on this would be much appreciated

=Sum(Aggr(Avg([Invoice Item Unit Price]))) but this is not working

once i have this i will add the set analysis for the year  

{<[Year]={'2019'}>}

but need to get the average right first. Any assistance would be very much appreciated.

Thank you in advance

Daniel

Labels (1)
2 Solutions

Accepted Solutions
Vegar
MVP
MVP

The average value of [Invoice Item Unit Price] is found by using avg([Invoice Item Unit Price]). You do not need to aggregate. 

If you do want to aggregate using aggr() then you need to define over which dimension you want to aggregate. The Aggr() takes two parameters. 

Aggr(Sum([Invoice Item Unit Price]),  DIMENSION)

View solution in original post

Taoufiq_Zarra

why  you need aggregation ?

=Avg([Invoice Item Unit Price])

and

=Avg({<[Year]={'2019'}>} [Invoice Item Unit Price])
Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉

View solution in original post

4 Replies
Vegar
MVP
MVP

The average value of [Invoice Item Unit Price] is found by using avg([Invoice Item Unit Price]). You do not need to aggregate. 

If you do want to aggregate using aggr() then you need to define over which dimension you want to aggregate. The Aggr() takes two parameters. 

Aggr(Sum([Invoice Item Unit Price]),  DIMENSION)

Taoufiq_Zarra

why  you need aggregation ?

=Avg([Invoice Item Unit Price])

and

=Avg({<[Year]={'2019'}>} [Invoice Item Unit Price])
Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
davyqliks
Specialist
Specialist
Author

WOW!

Massively over complicated that one. added the year set analysis and all good.

 

Thanks a lot.

 

davyqliks
Specialist
Specialist
Author

Hi

I have another post i am awaiting a reply on, i wonder if you could take a look.

thanks so much either way:

 

I need to find the % different between 2 sums, i have tried a few things but never get the calculated result below. 

sum({<[Year]={'2019'}>} [HKD_Price])

and

sum({<[Year]={'2018'}>} [HKD_Price]) 

The figures are as follows and so know the difference must like below

2760530389.02

1504520710.05

58.8978% difference