Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Guys,
I created two listboxes with month(Invoice Date) and year(Invoice Date).
When I select year 2015 in year(Invoice Date) it shows the month options for the same year but when I select month in the listbox month(Invoice Date) the year goes off from the year listbox.
Same thing is happening when going through the same process vice-versa.
Any suggestions?
Hi adheesh,
could you upload your qvw OR a couple of Screenshots to better illustrate the issue?
Andy
Month is a number or a string not related to the year, if you select February for example which year must be selected?
One approach could be using Year month selectors, a list box showing something like
201401 for jan 2014 and so on
I assume you mean you used expressions instead of fields for the listboxes? Selections in a listbox are made in the underlying field, which is in this case the same invoice date. As the selection changes the other listbox goes off. I suggest you create the month, year fields in the load script
Create your Month & Year in script
QuartersMap:
MAPPING LOAD
rowno() as Month,
'Q' & Ceil (rowno()/3) as Quarter
AUTOGENERATE (12);
Temp:
Load
min(OrderDate) as minDate,
max(OrderDate) as maxDate
Resident Orders;
Let varMinDate = Num(Peek('minDate', 0, 'Temp'));
Let varMaxDate = Num(Peek('maxDate', 0, 'Temp'));
DROP Table Temp;
TempCalendar:
LOAD
$(varMinDate) + Iterno()-1 As Num,
Date($(varMinDate) + IterNo() - 1) as TempDate
AutoGenerate 1 While $(varMinDate) + IterNo() -1 <= $(varMaxDate);
MasterCalendar:
Load
TempDate AS OrderDate,
week(TempDate) As Week,
Year(TempDate) As Year,
Month(TempDate) As Month,
Day(TempDate) As Day,
YeartoDate(TempDate)*-1 as CurYTDFlag,
YeartoDate(TempDate,-1)*-1 as LastYTDFlag,
inyear(TempDate, Monthstart($(varMaxDate)),-1) as RC12,
date(monthstart(TempDate), 'MMM-YYYY') as MonthYear,
ApplyMap('QuartersMap', month(TempDate), Null()) as Quarter,
Week(weekstart(TempDate)) & '-' & WeekYear(TempDate) as WeekYear,
WeekDay(TempDate) as WeekDay
Resident TempCalendar
Order By TempDate ASC;
Drop Table TempCalendar;
after i select year -2015 and i select month- feb year should still be 2015 unless the data is not there for the same year and month but I checked data is there...thn why its happening?
You have been given a solution by Stigchel above. Did you try it?
Yes Guys thank u it worked