Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
paulyeo11
Valued Contributor II

How to make my average stock amount display correctly ?

Hi All

When i select year = 2015 ,

How to make the average stock equal to  1,697 K ? Now it display 1,132 K when i set expression as average.

Kindly see my enclosed QV Doc.

Paul

1 Solution

Accepted Solutions
MVP
MVP

Re: How to make my average stock amount display correctly ?

You don't have any values for 15 March, so whatever you are getting is the right result but if you still want forcefully 1697, change your expressions as below

STOCK_OPEN

IF(sum({$<year = {$(=max(year))}, month = {"<=$(=max({<year={$(=max(year))}>} month))"}>} STK_OPEN/1000)>0,

sum({$<year = {$(=max(year))}, month = {"<=$(=max({<year={$(=max(year))}>} month))"}>} STK_OPEN/1000))

STOCK_CLOSE

IF(sum({$<year = {$(=max(year))}, month = {"<=$(=max({<year={$(=max(year))}>} month))"}>} STK_CLOSE/1000) > 0,

sum({$<year = {$(=max(year))}, month = {"<=$(=max({<year={$(=max(year))}>} month))"}>} STK_CLOSE/1000))

2 Replies
MVP
MVP

Re: How to make my average stock amount display correctly ?

You don't have any values for 15 March, so whatever you are getting is the right result but if you still want forcefully 1697, change your expressions as below

STOCK_OPEN

IF(sum({$<year = {$(=max(year))}, month = {"<=$(=max({<year={$(=max(year))}>} month))"}>} STK_OPEN/1000)>0,

sum({$<year = {$(=max(year))}, month = {"<=$(=max({<year={$(=max(year))}>} month))"}>} STK_OPEN/1000))

STOCK_CLOSE

IF(sum({$<year = {$(=max(year))}, month = {"<=$(=max({<year={$(=max(year))}>} month))"}>} STK_CLOSE/1000) > 0,

sum({$<year = {$(=max(year))}, month = {"<=$(=max({<year={$(=max(year))}>} month))"}>} STK_CLOSE/1000))

paulyeo11
Valued Contributor II

Re: How to make my average stock amount display correctly ?

Hi Sir

Thank you very much for your expression.

Paul

Community Browser