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

Limit dimension to show data for current year in qliksense

Hello All,

I have below dimension :-

Aspiring_Developer_0-1634800708399.png

This field has data starting from 2010 till Nov 2021. I am using this field as filter and also as a dimension in one of the charts.

I want to show the data only for current year i.e Jan 2021 till max . How can i restrict this dimension to show data only for current year ? Can anyone please help me ?

Thanks in advance

1 Solution

Accepted Solutions
Andrei_Cusnir
Specialist
Specialist

Hello,

 

In your use case scenario I would suggest using Filter pane with expression similar to "=If(WildMatch(DATE_FIELD, '*2021'), FIELD)". This expression will only show you the values of FIELD, where DATE_FIELD ends with "2021". For example dates such as "10/25/2021" or "01/12/2021" etc. If you would like to make it more scalable, you can add the "Year(Today())" part in your expression that will make sure that always the current year is used, without you needed to update the value manually each year. So the new expression looks like "=If(WildMatch(DATE_FIELD, '*' & Year(Today())), FIELD)". Below you will find the results of my testings:

 

The expression "DATE_FIELD" gives me:

 

The expression "=If(WildMatch(DATE_FIELD, '*' & Year(Today())), DATE_FIELD)" gives me:

 

I hope that this information was helpful. In case I have misunderstood the use case scenario, please elaborate further in details 

 

Help users find answers! Don't forget to mark a solution that worked for you! 🙂

View solution in original post

1 Reply
Andrei_Cusnir
Specialist
Specialist

Hello,

 

In your use case scenario I would suggest using Filter pane with expression similar to "=If(WildMatch(DATE_FIELD, '*2021'), FIELD)". This expression will only show you the values of FIELD, where DATE_FIELD ends with "2021". For example dates such as "10/25/2021" or "01/12/2021" etc. If you would like to make it more scalable, you can add the "Year(Today())" part in your expression that will make sure that always the current year is used, without you needed to update the value manually each year. So the new expression looks like "=If(WildMatch(DATE_FIELD, '*' & Year(Today())), FIELD)". Below you will find the results of my testings:

 

The expression "DATE_FIELD" gives me:

 

The expression "=If(WildMatch(DATE_FIELD, '*' & Year(Today())), DATE_FIELD)" gives me:

 

I hope that this information was helpful. In case I have misunderstood the use case scenario, please elaborate further in details 

 

Help users find answers! Don't forget to mark a solution that worked for you! 🙂