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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
smilingjohn
Specialist
Specialist

dt

I have a date filed as Date which has data from 2001 to till date ..

this field iam using it in the Dimesnion .

I want to show only 2 years data like ( from jan-2015 , Feb-2015.....till date )

How should i achieve this .

15 Replies
its_anandrjs
Champion III
Champion III

What is data format in this field and you need this in load script or UI let me know.

prma7799
Master III
Master III

in calculated dimension

=if(Match(Year(Date),2015,2016),Year,Null())

and tick suppress when value null

smilingjohn
Specialist
Specialist
Author

Hi Anand

The date format is

01-01-2017 00:12:22

its_anandrjs
Champion III
Champion III

For which two year data you need last 2 years or it is hardcoded.

smilingjohn
Specialist
Specialist
Author

my date format is date.PNG

prma7799
Master III
Master III

Could you please share some sample file?

or try like this in your back end

date(floor(timestamp#(date,'DD/MM/YYYY hh:mm:ss'))) as Date,

Year(date(floor(timestamp#(date,'DD/MM/YYYY hh:mm:ss')))) as Year

smilingjohn
Specialist
Specialist
Author

I want to show this like this dt1.PNG

Mark_Little
Luminary
Luminary

Hi john,

You want to start by Creating a master calendar. this will allow you then create a month year field to display as you have requested. look at the link below.

Creating A Master Calendar

Your Dimension would be MonthYear and then in your set analysis would contain {<Year={'>2014'}>}.

Mark

its_anandrjs
Champion III
Champion III

For this use this Dimension and Metrics expression.

Dim :- =MonthName(Date)

Expre:- =sum({<Date={">=$(=Date(AddMonths(Max(Date)-24)))"} >}   MetricsField)

Ex:- =Sum( {<Date={">=$(=Date(AddMonths(Max(Date)-24)))"} >}   Sales )