Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
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
Valued Contributor

Re: How to filter date to restrict data

use

load *

from *** . qvd

where year(Datefield)='2012'

load *

from *** . qvd

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

Not applicable

Re: How to filter date to restrict data

DO I need to use both these laod statement.?

Not applicable

Re: How to filter date to restrict data

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
Valued Contributor

Re: How to filter date to restrict data

yes this is correct

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

Not applicable

Re: How to filter date to restrict data

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

rajni_batra
Valued Contributor

Re: How to filter date to restrict data

can u share ur sample app

Not applicable

Re: How to filter date to restrict data

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

report.JPG

rajni_batra
Valued Contributor

Re: How to filter date to restrict data

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

kamalqlik
Valued Contributor

Re: How to filter date to restrict data

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

Regards

Kamal

Community Browser