Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

paulyeo11
Valued Contributor II

SET expression with Avg how to make it work in table and chart ?

Hi All

I have SET expression for chart 1 is show correctly:-

=(Avg({$<year = {$(=max(year))}, month = {"<=$(=max({<year={$(=max(year))}>} month))"}>} (STK_OPEN+STK_CLOSE)/2))

I use the same expression at Table 1  i need it display 12.5 , now it display 7 , how to make it display 12.5

when i click on month = 2 chart display Feb = 2.5 is correct , how to make tabble 1 display as 2.5 instead of 2 ?

Paul

1 Solution

Accepted Solutions

Re: SET expression with Avg how to make it work in table and chart ?

Hi paul, in table don't works because you're asking for month less or equal to max and you don't have month as dimension.

You can set month as dimension on table or change the expression to:

=(Avg({$<year = {$(=max(year))}, month = {"$(=max({<year={$(=max(year))}>} month))"}>} (STK_OPEN+STK_CLOSE)/2))

2 Replies

Re: SET expression with Avg how to make it work in table and chart ?

Hi paul, in table don't works because you're asking for month less or equal to max and you don't have month as dimension.

You can set month as dimension on table or change the expression to:

=(Avg({$<year = {$(=max(year))}, month = {"$(=max({<year={$(=max(year))}>} month))"}>} (STK_OPEN+STK_CLOSE)/2))

paulyeo11
Valued Contributor II

Re: SET expression with Avg how to make it work in table and chart ?

Hi Sir

Many thank. it work fine now.

Paul

Community Browser