Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts,
i need to calculate YTD sales.
i m using the below expression
Sum({<Year=, MonthYear =,Date= {">=$(=date(YearStart(vMaxSalesDate)))<=$(=date(vMaxSalesDate))"}>}sales)
where vMaxSalesDate = Max(Date)
the expression is correct and working fine.
it is giving sales from year start till date.
the problem is when i select a month in the middle, ex: if i select Sep 2015. the sales value changes as year start till sep 2015 end.
but my requirement is to keep YTD fixed.
Whatever calendarmonth or calendar date may be selected, the YTD value should be fixed as Jan2015 till 9/12/2015.
how can i do this. pls help me on the expression.
Hi,
May be change your variable expression like
Max ({1}Date)
Edit:
The above expression for till date..
You can directly apply this in your expression because you are using same variable in both criteria..like
Sum({<Year=, MonthYear =,Date= {">=$(=date(YearStart(vMaxSalesDate)))<=$(=date(max ({1}Date)))"}>}sales)
Where vMaxSalesDate Max (Date)
hi,
https://community.qlik.com/docs/DOC-9144
https://community.qlik.com/docs/DOC-8574
hope this helps you
Thanks
Suresh
hi
can you please help me on my expression
Hi,
May be change your variable expression like
Max ({1}Date)
Edit:
The above expression for till date..
You can directly apply this in your expression because you are using same variable in both criteria..like
Sum({<Year=, MonthYear =,Date= {">=$(=date(YearStart(vMaxSalesDate)))<=$(=date(max ({1}Date)))"}>}sales)
Where vMaxSalesDate Max (Date)
Hello,
Try
Sum({<Year = {$(=max(Year)}, MonthYear =, Date =>}sales)