Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

paulyeo11
Valued Contributor II

sum(-sales*YearToDate(date, year-Year(Today()))) How to modify so that compare from Jan till May not till june ?

Hi All

I have this expression working fine :-

sum(-sales*YearToDate(date, year-Year(Today())))

Above expression will comppute Jan till today sales for every year.

As Now is 15 June , for 2016 june sales data it will only available on 1 July 2016 when account close.

My question is it is possible to modify the expression to compute the YTD sales till last month , 30 May 2016 and not 1 jan 2016 till 15/6/2016 ?

So that the compare will be same for CY and LY base on 5 month , and now is compare Last year from 1/1/2015 till 15/6/2015 and current year from 1/1/2016 till 30/5/2016.

Paul

1 Reply
paulyeo11
Valued Contributor II

Re: sum(-sales*YearToDate(date, year-Year(Today()))) How to modify so that compare from Jan till May not till june ?

my qv doc

Community Browser