Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
yvonne-c
Creator
Creator

Expression to show all values

Im trying to complete the table below, can anybody help with the changes to the DLWG 3 batch per rearer expression to make this table populate completely,  and so I can show these values in a chart?

DLWG :

Avg({<[DLWG1]-={"0"},[DATE IN] = {"$(=Max([DATE IN]))"}>} aggr(rangeavg(above(Total Avg({<[DATE IN]=,[DLWG1]-={"0"}>}DLWG1),0,3)),[DATE IN]))

DLWG 3 batch:

Avg({<Rearer,[DLWG1]-={"0"},[DATE IN] = {"$(=Max([DATE IN]))"}>}Aggr(rangeavg(above(Total Avg({<Rearer,[DATE IN]=,[DLWG1]-={"0"}>}DLWG1),0,3)),[DATE IN],Rearer))

This should be the average of DLWG1 for the 3 most recent DATE IN per REARER

Capture.JPG

Some sample data attached

Labels (3)
1 Solution

Accepted Solutions
Frank_Hartmann
Master II
Master II

see attached file

Unbenannt.png

hope this helps

View solution in original post

5 Replies
Frank_Hartmann
Master II
Master II

can u share the qvw or at least some rawdata?

yvonne-c
Creator
Creator
Author

Example of data attached, this is what I am trying to achieve

Thanks

Example.JPG

Frank_Hartmann
Master II
Master II

see attached file

Unbenannt.png

hope this helps

yvonne-c
Creator
Creator
Author

Thankyou !  

Yes that works, the only problem is when there are less than 3 batches. 

So is there a way I can change the /3 part on the end to divide by a count of the DATE IN up to 3  ( so if there are only two batches it will divide by two)

Frank_Hartmann
Master II
Master II

see attached qvw