Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

YTD exclude current month.

Hi, How to exclude current month which is running now ,not to show in ytd even they select current month ?

For now, I have taken max(year) and <=max(month) to show YTD in expression.

Labels (1)
8 Replies
aveeeeeee7en
Specialist III
Specialist III

max(yearfieldname) and Monthfieldname<>Month(today())

Anonymous
Not applicable
Author

this will not include for months of previous year also,

for example if I select 2013, August; it will only show till July 2013... I think I have to take Yearmonth as reference...

joshabbott
Creator III
Creator III

YTD shouldn't include month's from a previous year. 

Anonymous
Not applicable
Author

ytd will not include months from previous year but when i select prevous year and a month, it will show ytd for that year and till that month selected.

joshabbott
Creator III
Creator III

Ahh, I gotcha.

[Your Month Field] < Month(Today())

Anonymous
Not applicable
Author

This is not actually I am looking for.Above expression for 2014 It will give correct display but when I select 2013 or 2012 will also exclude month(today()). I want for previous years to have YTD till august end by selection of august and for current year should have till July.

I know it should have reference of month-year concatenated field... I am not able to put it in expression.

joshabbott
Creator III
Creator III

Will they only be selecting one year?

If so:

if(year(today()=only([selected year field]), [Your Month Field]< Month(Today()), [Your Month Field] <= Month(Today()))

Anonymous
Not applicable
Author

but now, I am using set analysis, how can I make it ?

Capture.PNG

How Can I make it to If condition?