Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
deepakqlikview_123
Specialist
Specialist

Showing data before 180 days and 365 days from current date

Hi All,

My date is in MM/DD/YYYY format.

I need to show data for same dimesiona before 180 days and 365 days from current date can you please suggest set analysis expression for this.

Thanks

9 Replies
Anonymous
Not applicable

{<Date={"$(='>=' & date(today()-365) & '<=' & date(today()-180))"}>}

deepakqlikview_123
Specialist
Specialist
Author

Hi Michael,

thanks for response.

But i need to show it from specific date not from todays date.

Date would be in MM/DD/YYYY format.

Thanks

ToniKautto
Employee
Employee

Is this specific date different for each row in your chart? Or is it the same reference date for all rows?

Could you provide a simple QVW file with sample data and describe what the chart is expected to show?

Anonymous
Not applicable

Replace today() in the set above with the specific date.

As for the format - if the data format in your QV file script is defined as 'MM/DD/YYYY', you don't need to do anything special about that.  If it is different, add format into the date() function:

date(YourDate-180, 'MM/DD/YYYY')

Keep in mind that the Date field must be in the same format for this set to work.

If it's not clear enough, upload a sample of our file, as tko‌ said.

deepakqlikview_123
Specialist
Specialist
Author

Hi,

I need to show data before 180 days and 365 days from 12 feb 2014.

Can you please suggest what would be syntax for this in set analysis.

Thanks

maxgro
MVP
MVP

maybe (my date format is DD/MM/YYYY)

sum({<Date={"$(='>=' & date('12/02/2014'-365) & '<=' & date('12/02/2014'-180))"}>} something)

pratap6699
Creator
Creator

i think your requirement is like this

sum({<date={">=01-06-2014<=31-12-2014"}>}sales)....so our expression will be

sum({<date={">=monthstart(addmonths(max(date),-6))<=monthend(max(date))"}>}sales)

deepakqlikview_123
Specialist
Specialist
Author

for getting data for 1 year back i am using below expression whhih is not working

=Sum({<INDICATOR_NAME={'US Treasury BVAL Curve 3M','US Treasury BVAL Curve 6M','US Treasury BVAL Curve 1Y','US Treasury BVAL Curve 2Y','US Treasury BVAL Curve 3Y','US Treasury BVAL Curve 5Y','US Treasury BVAL Curve 7Y','US Treasury BVAL Curve 8Y','US Treasury BVAL Curve 9Y','US Treasury BVAL Curve 10Y','US Treasury BVAL Curve 15Y','US Treasury BVAL Curve 20Y','US Treasury BVAL Curve 25Y','US Treasury BVAL Curve 30Y'},DATE={"=$(=date('2/12/2015'-365))"}>}INDICATOR_VALUE)

plz suggest.I need to show values for 1 date not for perticular range.

Thanks

antoniotiman
Master III
Master III

Hi Deepak,

Try to remove = from

,DATE={"=$(       ->     ....,DATE={"$(=date(.........

Regards,

Antonio