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

In-record AVG

Hello everybody!

I have some intersting ( for me ) case.

Data:

img-2020-08-20-16-51-22.png

I need to do in script AVG() for prices if they changed in one month:

img-2020-08-20-16-53-32.png

How i can do this?

Thank u!

Sergio

1 Reply
Brett_Bleess
Former Employee
Former Employee

You will need to get the data ordered in the load scrip such that you can use Peek() function to determine when things have changed and do your check to see if next record requires the average etc.  If you want to do things in the visualization, then Set Analysis is likely the only option I believe.  Here are some links that may be helpful:

https://community.qlik.com/t5/Qlik-Design-Blog/Average-Which-average/ba-p/1466654

https://community.qlik.com/t5/Qlik-Design-Blog/A-Primer-on-Set-Analysis/ba-p/1468344

https://community.qlik.com/t5/Qlik-Design-Blog/Set-Analysis-in-the-Aggr-function/ba-p/1463822

https://help.qlik.com/en-US/qlikview/April2020/Subsystems/Client/Content/QV_QlikView/Scripting/load-...

About the best point in the right direction I have, hopefully helps a little.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.