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

Average Expression help

Hi Experts,

Can any one please  help me on below requirement.

I have a bar chart like below with 2017 and 2018 Amount and based on 2017 amount created Avg 2017 amount reference line and its showing correct fixed value as 5.46 but when i have converted this bar chart into combo chart here the avg amount showing  different for each month getting like below table values but the requirement is i need to show 5.46 fixed avg income value in all the months in combo chart also.

 

 

Expressions used:

2017 Amount:

fabs(RangeSum(Sum({$<Year ={'$(=Year(Max([Reporting Date]))-1)'},Month,MonthYear=>}[Amount])/1000000,
-Above(Sum({$<Year ={'$(=Year(Max([Reporting Date]))-1)'},Month,MonthYear=>}[Amount])/1000000
)))

2017 Avg Amount:

Sum({$<Year ={'$(=Year(Max([Reporting Date]))-1)'},MonthYear=>}

Aggr(Fabs(if(Rowno()=1,

Sum({$<Year ={'$(=Year(Max([Reporting Date]))-1)'},MonthYear=>}[Amount])/1000000,

Sum({$<Year ={'$(=Year(Max([Reporting Date]))-1)'},MonthYear=>}[Amount])/1000000-
Above(Sum({$<Year ={'$(=Year(Max([Reporting Date]))-1)'},MonthYear=>}[Amount])/1000000)

)),Year,MonthYear))/12

Actual and expected result is highlighted here. Please help me to modify the 2017 Avg A Mount expression to get the fixed 5.46 value for all the months. 

expected.png

6 Replies
pawwy1415
Creator III
Creator III
Author

Hi @sunny_talwar 

Could you please help me on this requirement.

Thanks in advance.

Channa
Specialist III
Specialist III

avg(total fabs(RangeSum(Sum({$<Year ={'$(=Year(Max([Reporting Date]))-1)'},Month,MonthYear=>}[Amount])/1000000,
-Above(Sum({$<Year ={'$(=Year(Max([Reporting Date]))-1)'},Month,MonthYear=>}[Amount])/1000000
))))

 

try this

Channa
pawwy1415
Creator III
Creator III
Author

Hi @Channa 

I have tried your solution but its not working getting null on expression.

Channa
Specialist III
Specialist III

can you attach APP with sample data

TOTAL is aggregate we use it show sum all 

u need to add AVG(total ur exp)

see attach example

Channa
Channa
Specialist III
Specialist III

@pradosh_thakur 

Hi pradosh i tried this he still have problem can you take a look

Channa
pradosh_thakur
Master II
Master II

Sure .. Let me have a look.

 

Learning never stops.