Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
Do you want set expression.? If so, try
Sum({$<Date={">=$(=MonthStart(AddMonths(Today(),-3)))<$(=MonthEnd(AddMonths(Today(),-1)))"}>} Sales)
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
Hi,
Use this expression in your Table,
Sum({<Year=, Month =, Date={"$(='>=' & MonthStart(Today(), -2) & '<=' & MonthEnd(Today()))"}>} Sales)
HTH,
Hirish
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
You have to create a Variable
vPreviousMonth =Monthstart(today(),-4);
vCurrentMonth =MonthEnd(Today(),-1);
Use the same Variable where you Required
This should work and probably a correct answer
Hi,
The bellow exprection is working fine for me.
=count({<Date = {'>$(=Max((Addmonths(Date,-3)))) <$(=Max (Addmonths(Date)))'}>} CallID)
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')& ')'