
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Last 3 months data
Hi Experts,
i have 3 years of data with date field , but i need last 3 months of data Excluding current month.
for EX:- now April month is current month but i need "JAN,FEB,MARCH"
once if enter to "MAY" month i need "FEB,MARCH,APRIL" data.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do you want set expression.? If so, try
Sum({$<Date={">=$(=MonthStart(AddMonths(Today(),-3)))<$(=MonthEnd(AddMonths(Today(),-1)))"}>} Sales)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
create variable in script like
vLast3MonthStartDate=Monthstart(today(),-4);
vLastMonthEndDate=MonthEnd(Today(),-1);
while loading data use variable in where clause
like
Load *
from table
where Date>=$(vLast3MonthStartDate) and Date<=$(vLastMonthEndDate)
Regards
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Use this expression in your Table,
Sum({<Year=, Month =, Date={"$(='>=' & MonthStart(Today(), -2) & '<=' & MonthEnd(Today()))"}>} Sales)
HTH,
Hirish
“Aspire to Inspire before we Expire!”

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
I will suggest dont use expression as its lower the performance.
I already face issue on same.
Go by dreamer4 way suggested.
Define variables and pass to scripts.
That will faster performance while you loading data.
This all when you have high amount of data.
Regards,
Lokesh


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You have to create a Variable
vPreviousMonth =Monthstart(today(),-4);
vCurrentMonth =MonthEnd(Today(),-1);
Use the same Variable where you Required

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This should work and probably a correct answer

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
The bellow exprection is working fine for me.
=count({<Date = {'>$(=Max((Addmonths(Date,-3)))) <$(=Max (Addmonths(Date)))'}>} CallID)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
if you want to select you can used below equation
='('& Date(monthname ( Today()),'MMM') & '|'& Date(monthname ( AddMonths(Today(),-1)),'MMM')& '|'& Date(monthname ( AddMonths(Today(),-2)),'MMM')& ')'
