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

Trend Lines - AVG(AGGR()) problems in calculations

Having problems while calculations Trend Lines per day

1.pngHere you can see  the calculations by days, which are unfortunately wrong. 

Because when you select a specific day, a different value is displayed.

 

 

2.pngYou can see that in the photo above, the value for the third day is 18,5. However, when the third day is selected the value changes to 45,6 which is actually the correct value.

 

 

Here's what the formula looks like :
[Avy] *
(sum(aggr((sum({<Plant={'UM'}>}TotalLength) / sum({<Plant={'UM'}>}total <Day> TotalLength)) * avg(aggr((sum({<Plant={'UM'}>}TotalLength) / (sum({<Plant={'UM'}>}PerformanceTime) * 60)) / sum(aggr(only({<Plant={'UM'}>}[Planned speed]), WopID)), WopID)), Day, WopID)))
* [Qty]

=> [Avy] and [QTY] are good parts and they do not cause the problem in selections, I know that. 

Labels (5)
2 Replies
mato32188
Specialist
Specialist

Hi @okin_pfa ,

it is very hard to confirm solution without having sample data, but I see that you use total <Day> in one place, but not in other ones. Maybe try to include total <Day> in your partial expressions and you will find solution.

BR

m

ECG line chart is the most important visualization in your life.
tfogarty
Contributor
Contributor

Also having this issue, using a YearMonth dimension against aggregate measures!