Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to filter date to restrict data

Hi

I want to apply filter on year, I am able to see many years of data like 2010,2011,2012 etc.. I would like to see present data only i.e. from JAN 2012- till date.

How can I acheive this? Here I am making 'changes into Server Monitoring Report'

BR,

anta

18 Replies
rajni_batra
Specialist
Specialist

use

load *

from *** . qvd

where year(Datefield)='2012'

load *

from *** . qvd

where year(Datefield)>=year(today())

Not applicable
Author

DO I need to use both these laod statement.?

Not applicable
Author

Ok, for example if we assume below code is it correct?

QVSTime:

Load DISTINCT

          DateMinuteKey,

          Date(floor(Timestamp)) as date,

          weekday(Timestamp) as Weekday,

          Year(Timestamp) as Year,

          Month(Timestamp) as Month,

          num(Month(Timestamp)) as MonthNbr,

          Week(Timestamp) as Week,

          Day(Timestamp) as Day,

          Hour(Time(Timestamp)) as Hour,

          Minute(Time(Timestamp)) as Minute,

          Date(MonthStart(Timestamp),'MMM-YYYY') as YearMonth,

          WeekStart(Timestamp) as YearWeek

resident $(myFile) where Year(Timestamp)='2012';

I want to fetch data from 2012 only. I don't need previous years of data now.

rajni_batra
Specialist
Specialist

yes this is correct

reload this n check the output i hope u will get ur  desired result...

Not applicable
Author

Already did but still I am able to see 2011 data also

rajni_batra
Specialist
Specialist

can u share ur sample app

Not applicable
Author

I can not share that application but may be a snapshot.

report.JPG

rajni_batra
Specialist
Specialist

But this should not happen i have attched a sample please check that out

kamalqlik
Partner - Specialist
Partner - Specialist

Hi try using thisYear(Timestamp)<>Year that you want to show.

Regards

Kamal