Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Help with listboxes

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?

7 Replies
awhitfield
Partner - Champion
Partner - Champion

Hi adheesh,

could you upload your qvw OR a couple of Screenshots to better illustrate the issue?

Andy

alexandros17
Partner - Champion III
Partner - Champion III

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

stigchel
Partner - Master
Partner - Master

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

Kushal_Chawda

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;

Anonymous
Not applicable
Author

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?

jonathandienst
Partner - Champion III
Partner - Champion III

You have been given a solution by Stigchel above. Did you try it?

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable
Author

Yes Guys thank u it worked