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

Edit scipt: 2015 only

Hi All,

How does one only extract information from 2015 in from script tables in QVD?

The tables have information from many years ago and if I can only include 2015YTD worth of information that would be ideal.

The table names are Activity.DueDate, Activity.PlannedDate and Activity.CreatedDate and Im thinking its something like the image I have posted below but it does not seem to work correctly. Any advise is greatly appreciated. Many thanks.

load year 15.PNG

1 Solution

Accepted Solutions
Anonymous
Not applicable

Yes, but it looks a little different:

WHERE InYear(fieldname, today(),0)

View solution in original post

8 Replies
buzzy996
Master II
Master II

where year(urdatefield)=year(today());

sunny_talwar

This could be a potential issue at the beginning of next year. Let say if the application is reloaded on Jan 1st 2016 and there is no data point for 2016 available then the application won't reload. Would this be a possibility?

Where Year(DateField) = if(Month(Today()) = 'Jan' and Day(Today()) = 1, Year(today()) - 1, Year(Today())); (Updated)

This could be further configured based on when the 2016 data needs to be included and 2015 to be excluded.

I have never used if with where before, so not 100% sure if this is going to work or not. But def. worth giving a shot.

HTH

Best,

Sunny

buzzy996
Master II
Master II

ur absolute right,but  the subject line says looking only for 2015;

sunny_talwar

Hahahaha that's true. then why not just do like this:

Where Year(DateField) = 2015; (Why check against Year(Today())?)

knightwriter
Creator III
Creator III
Author

Thanks for the responses. Would InYear(fieldname) work also?

sunny_talwar

Hi Stephen,

According to this, it should work (Extract from QlikView help)

Anonymous
Not applicable

Yes, but it looks a little different:

WHERE InYear(fieldname, today(),0)

buzzy996
Master II
Master II

good counter ..like it.