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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
knightwriter
Creator III
Creator III

Range of dates / years

    Hi all,

I have a chart and it shows years from 2005 to 2020, how do I narrow this down to show only 2015 or 2015-2020

I have tried =year(competition. start date) = '2015' and it does not work. Appreciate any help.

Thank you

1 Solution

Accepted Solutions
sunny_talwar

If you just want to see the year, try this:

=If(Year([Opportunity.Anticipated Close Date]) >= 2015, Year([Opportunity.Anticipated Close Date]))

View solution in original post

10 Replies
sunny_talwar

You can do this two ways:

1) change your dimension Year to a calculated dimension and select 'Suppress when Value Is Null' option on Dimension properties tab

If(Year = 2015, Year) for 2015 only

If(Year >=2015, Year) for 2015-2020

2) Using Set analysis in your expressions:

{<Year = {'2015'}>} for 2015 only

{<Year = {'>=2015'}>} for 2015-2020

HTH

Best,

Sunny

sasiparupudi1
Master III
Master III

Untitled2.jpg

knightwriter
Creator III
Creator III
Author

Hi Sunny,

Thanks for the idea. The field which I am using is a date filed and I have included your expression but I still cannot get it to work. Any ideas?

sasiparupudi1
Master III
Master III

It should be

if(Year([Your Date Field])>=2015, [Your Date Field])

knightwriter
Creator III
Creator III
Author

Thank you but see result below. How do I get this to show just the year or the month?

sunny_talwar

If you just want to see the year, try this:

=If(Year([Opportunity.Anticipated Close Date]) >= 2015, Year([Opportunity.Anticipated Close Date]))

kavita25
Partner - Specialist
Partner - Specialist

Hi,

=if(year(DATE_Field)='2015',(year(DATE_field)) for 2015

=if(year(DATE_Field)>='2015',(year(DATE_field)) for for 2015-2020


Hope it helps you.


Regards,

Kavita

jagan
Partner - Champion III
Partner - Champion III

Hi,

Arrive a year field from that Date in script and use this in frontend, it is not a good practice to use calculated dimension in charts.  It may cause performance issues.

LOAD

*,

Year(DateFieldName) AS Year

FROM DataSource;

Now in front end

Dimension: Year

Expression: Sum({<DateFieldName=, Year={'>=$(=Year(Today()))'}>} MeasureName)

Replace DateFieldName and MeasureName with your actual field names.

Regards,

Jagan.

sunny_talwar

Try this for Year:

=If(Year([Opportunity.Anticipated Close Date]) >= 2015, Year([Opportunity.Anticipated Close Date]))

And for Month you can try this:

=If(Year([Opportunity.Anticipated Close Date]) >= 2015, MonthName([Opportunity.Anticipated Close Date]))