Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi all,
Create a list box which shows last 6 month from till date.
Create a list box to show last six month from a particular selected month.
can u pls help in this , i have used addmonth function but it is giving me +6 months date from current date in list box, i want to show all six months from current date.
Use below script...
================
MinMaxDate:
Load
MakeDate(2011) as MinDate,
Today() as MaxDate
AutoGenerate 1;
Let vMin = NUM(Peek('MinDate',0,'MinMaxDate'));
Let vMax = NUM(Peek('MaxDate',0,'MinMaxDate'));
Drop Table MinMaxDate;
Calendar:
Load
Date(TempDate) as Date,
Month(TempDate) as Month,
Date(MonthStart(TempDate),'YYYYMM') as MonthYear;
Load
$(vMin) + IterNo() - 1 as TempDate
Autogenerate 1
While $(vMin) + IterNo() - 1 <= $(vMax);
====================================
Create a list box with below expression
=IF(MonthYear > AddMonths(MonthStart(Today()),-6), Month)
or
=IF(MonthYear > AddMonths(MonthStart(Today()),-6), MonthYear)
Provide sample data with your requirements... Need to see how your month field is !
Load * inline [
MinDate,Maxdate
01/01/2009,12/15/2011
];
let vMin=Peek('MinDate',0,'Calender1');
let vMax=Peek('Maxdate',0,'Calender1');
Tempcalender:
Load
Date('$(vMin)'+iterno()-1) as tempdate
autogenerate 1 while '$(vMin)'+iterno()<='$(vMax)';
I have created this script and have no sample data for that......and have this requirement.
Create a list box which shows last 6 month from till date.
Create a list box to show last six month from a particular selected month.
Calendar1:
Load * inline [
MinDate,Maxdate
01/01/2009,12/15/2011
];
let vMin=Peek('MinDate',0,'Calender1');
let vMax=Peek('Maxdate',0,'Calender1');
Tempcalender:
Load
Date('$(vMin)'+iterno()-1) as tempdate
autogenerate 1 while '$(vMin)'+iterno()<='$(vMax)';
Use below script...
================
MinMaxDate:
Load
MakeDate(2011) as MinDate,
Today() as MaxDate
AutoGenerate 1;
Let vMin = NUM(Peek('MinDate',0,'MinMaxDate'));
Let vMax = NUM(Peek('MaxDate',0,'MinMaxDate'));
Drop Table MinMaxDate;
Calendar:
Load
Date(TempDate) as Date,
Month(TempDate) as Month,
Date(MonthStart(TempDate),'YYYYMM') as MonthYear;
Load
$(vMin) + IterNo() - 1 as TempDate
Autogenerate 1
While $(vMin) + IterNo() - 1 <= $(vMax);
====================================
Create a list box with below expression
=IF(MonthYear > AddMonths(MonthStart(Today()),-6), Month)
or
=IF(MonthYear > AddMonths(MonthStart(Today()),-6), MonthYear)
Hi Ankit
Try if this helps Datecolumn > addmonths(Now(),-6)
Thanks
Saumitra
Thanks man , got it @manish
There some little change in your load script and try like this way
Calendar1:
Load * inline [
MinDate,Maxdate
01/01/2009,07/09/2014
];
let vMin=Peek('MinDate',0,'Calender1');
let vMax=Peek('Maxdate',0,'Calender1');
DROP Table Calendar1;
Tempcalender:
LOAD
Year(tempdate) as Year,
Month(tempdate) as Month,
tempdate,
tempdate as CalDate;
Load
Date('$(vMin)'+iterno()-1) as tempdate
autogenerate 1
while '$(vMin)' + iterno() -1 <='$(vMax)';
LOAD
CalDate,
IF(tempdate > AddMonths(MonthStart(Today()),-5), Month) as Last6Months
Resident Tempcalender;