Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

yvonne-c
Contributor

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
Honored Contributor II

Re: Expression to show all values

see attached file

Unbenannt.png

hope this helps

5 Replies
Frank_Hartmann
Honored Contributor II

Re: Expression to show all values

can u share the qvw or at least some rawdata?

yvonne-c
Contributor

Re: Expression to show all values

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

Thanks

Example.JPG

Frank_Hartmann
Honored Contributor II

Re: Expression to show all values

see attached file

Unbenannt.png

hope this helps

yvonne-c
Contributor

Re: Expression to show all values

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
Honored Contributor II

Re: Expression to show all values

see attached qvw