Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Current Year Values

Hi All,

I am trying to count only values within the current calendar year and failing. Please could someone point me in the right direction!

I have the following

=count({<DateRaisedIMS={"=year(Today())"},ValueID={'*24*'}, IncidentType={'*Accident*'}, ListTitle={'*Employee*'}>}ValueID)

However this brings back every Value ID in the system

How do I tweak this to just bring back current calendar year figures? I do not want to define a date as it will be part of a dashboard

Thanks in advance

Toby

16 Replies
sunny_talwar

Forgot to close the parenthesis after Year(DateRaisedIMS


Try this:


=count({<DateRaisedIMS={"=Year(DateRaisedIMS) = year(Today())"},ValueID={'*24*'}, IncidentType={'*Accident*'}, ListTitle={'*Employee*'}>}ValueID)

Not applicable
Author

Can I do it without defining a date range?

I want to make the dashboard 100% self sufficient (as much as possible) without amending the script every year

Thanks

Not applicable
Author

Perfect, thank you Sun

You guys are awesome as always, thanks everyone that replied !

Anonymous
Not applicable
Author

Toby

Ignoring the rest of your Set Analysis, does this work and juist return this year data ?

count  ( {<DateRaisedIMS={">=$(=yearstart(Today()))"}>} ValueID)

If ok then add in the rest of your Set Analysis :

count({<DateRaisedIMS={">=$(=yearstart(Today()))"},ValueID={'*24*'}, IncidentType={'*Accident*'}, ListTitle={'*Employee*'}>}ValueID)

sunny_talwar

No Problem

jpenuliar
Partner - Specialist III
Partner - Specialist III

No need to define any dates if you will implement in Script:

You can add this in your Calendar Script, something like:

f(InYear(TempDate,Today(),0),1,0) as CurrentYearFlag,

Also Plenty of Gold Tips  at below:

QlikView How To (or Tips & Tricks) Application by Lee Matthews

  http://community.qlik.com/docs/DOC-5486

Not applicable
Author

Thanks Jonathan, I will take a look at that application!

Toby