YTD In Qlikview

Sum({< DateField = {“>=$(=Date(YearStart(vSelectedDate)))<=$(=Date(vSelectedDate))”} >} Sales)

Sum({<Year=, Month=, Week=, Date={‘>=$(=YearStart(Today()))<=$(=Today())’}>} Sales )

Sum({< Month,Year,Date = {‘>=$(=Date(YearStart(max(Date))))<=$(=Date(max(Date)))’} >} Sales)

YTD Average:

Sum({< Monthname,Year,Month={“>=$(=Date(YearStart(max(Month)),’YYYY MMM’))<=$(=Date(max(Month),’YYYY MMM’))”} >} Sales)
Count( {<Monthname,Month={“>=$(=Date(YearStart(max(Month)),’YYYY MMM’))<=$(=Date(max(Month),’YYYY MMM’))”}>}DISTINCT Month)

Monthname is in MMM format.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.