Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
JLob
Contributor II
Contributor II

How to show only the months from this year?

Hello, 

I have a line graph where the y-axis is % and the x-axis has the field "Date_Time" that is formated to mm/dd/yyyy 00:00:00. Right now I converted the Date_Time field to Month(Date_Time) which show me all the months throughout the data's history. But I want to only show data from the most current year's months. So currently the year 2022 and so I only want to show Jan, Feb, Mar, Apr, May of this year. How would I do that in a calculated dimension?

Thanks.

5 Replies
edwin
Master II
Master II

add the constraint in your measure by adding the set analysis modifier

{<Year={$(=year(today())}>}

this is of course assuming you have a Year field.  if you dnt, add that to your DM.

Daniel044
Contributor II
Contributor II

2. Go to Format > Bar Styles group > Format and in the lower part of the Format Bar Styles window select the "Text" tab and set it to the text field you customized. Set the text display the same for any other Gantt Bars where you want only the month and year to be shown. MyFortiva

JLob
Contributor II
Contributor II
Author

This formula doesn't seem to be working. Or maybe I'm implementing it wrong?

I'm using QlikView and my field is "Date_Time". The field shows all data points like this: 05/26/2022 09:00:00 

What I need is for "Date_Time" to show only this year's current months. So Jan, Feb, Mar, Apr, May.

What I've tried: Month(Date_Time) which displays all the months Jan-Dec and also all the data from previous years. I only need data from the most current year and it's months.

 

JLob
Contributor II
Contributor II
Author

I don't see any of those options. I'm using QlikView by the way. 

Can you explain further?

edwin
Master II
Master II

normally, what you do is control the dimension to show only the aggregation level you want in this case, either the month field or computed month(more granular date field).

you limit the scope in your expression, ideally, you should have a year field or at least a month field and you use these fields in your set analysis.  i suggest you add these fields into your data model else the expressions will be complex and harder to  maintain