Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

paulyeo11
Valued Contributor II

How to modify YTD expression to Current month ?

Hi All


This expression work fine , it display YTD sales target .

=num(Sum({$<year = {$(=Max(year)-0)}, month = {"<=$(=Max({<year={$(=Max(year))}, sales = {'*'}>} month))"}>}sales_target/1000)/$(Columndim89))


I wanted to change the expression to current month sales target.


I want to display 850


Hope some one can advise me.


Paul Yeo

3 Replies
paulyeo11
Valued Contributor II

Re: How to modify YTD expression to Current month ?

my QVW

karthikoffi27se
Contributor III

Re: How to modify YTD expression to Current month ?

Hi Yeo

Try this

Floor(Date) AS DateKey


Sum({<DateKey={">=$(=Num(MonthStart(Max(DateKey)))) <=$(=Num(Max(DateKey)))"}>}Sales)


Many Thanks

Karthik

paulyeo11
Valued Contributor II

Re: How to modify YTD expression to Current month ?

Hi Sir


I have try your recomeended expression , but it display null.


D AS Date,


=num(Sum({<Date={">=$(=Num(MonthStart(Max(Date)))) <=$(=Num(Max(Date)))"}>}sales)))


i Expect it display 216


From below expression :-

=num(Sum({$< Month_n  ={"1"}>} sales/1000)/Rate  )


But i don't want to use Month_n field , instead i want to use SET analysis.



Paul Yeo

Community Browser