Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Leverage your QlikView investment to modernize BI – see how! Join Group
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor

Want Expression to get average closing value

Hi,

I  attached my sample data and i want to get avg closing value for selected date from my source Table data.

i used this below expression but not work

num((((sum({1<DOCDATE=$::DOCDATE,

DOCDATE = {"$(01/04/2018)"},

MOVEMENT={'1'}

>}STOCK))

+

(sum({1<DOCDATE=$::DOCDATE,

DOCDATE = {">$(01/04/2018)<$(vFromDate)"},

MOVEMENT={'1'}

//DOCDATE = {'$(vFromDate)'}

>}STOCK)))

-

(sum({1<DOCDATE=$::DOCDATE,

DOCDATE = {">$(01/04/2018)<$(vFromDate)"},

MOVEMENT -= {'1'}

>}STOCK)))

/

Count(DISTINCT{1<DOCDATE=$::DOCDATE,

DOCDATE = {">$(01/04/2018)<=$(vFromDate)"}>}DOCDATE)

+

(sum({1<DOCDATE=$::DOCDATE,

DOCDATE = {">=$(vFromDate)<=$(vToDate)"},

MOVEMENT={'1'}

>}STOCK)

-

sum({1<DOCDATE=$::DOCDATE,

DOCDATE = {">=$(vFromDate)<=$(vToDate)"},

MOVEMENT={'-1'}

>}STOCK))

/Count(DISTINCT DOCDATE)

,'##0')

Thanks advance

Sasikumar

avg closing stock.jpg