Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

select month name based on selected date

Hi,

I have three list box Year,Day(1,2,3..) and monthNam(Jan,Feb,Mar..) and 2 calendar object.

Based on the selected start date and end date in the two calendar objects i need to auto select year, days and MonthName in the 3 list boxes.

Year and Day i am able to select by using Search String action on respective fields when start date and end date are selected,

But same logic when i apply on Monthname it does not work. Below are the search strings i tried to auto select month but doesn't work

='=' & Month(vFromDate) & '=' & Month(vTodate)

='>=' & Month(vFromDate) & '<=' & Month(vTodate)

Can someone helpout on this

10 Replies
Not applicable
Author

Hi,

Can you please post your sample file

Not applicable
Author

Hi,

I have attached sample.qvw. In this when you select any start date and end date in calendar object, the year and day listbox auto select based on calendar dates.

I have done this by adding trigger on variables vstartdate and venddate which are used in calendar object.

But when same logic i apply on MonthName it fails

tresesco
MVP
MVP

Try something like:

='(>=' & Month(vFromDate) & '| <=' & Month(vTodate)&')'

abeyphilip
Creator II
Creator II

Hi,

See the expression for Month and Day list boxes.

Regards,

Abey

Not applicable
Author

Thanks for the reply, but it still doesn't work

MayilVahanan

Hi

Try like this

Instead of selectedField option, try select possible in both variable trigger

Select Possible -> MonthName

Hope tat helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

i didn't got you Abey. As in list box i am directly using field. So the expression will be empty. Moreover day part is working , i am facing issue only in month.

Anonymous
Not applicable
Author

Hi

To create a variable

vstartdate=makedate(year(venddate),01,01)

venddate

vpstartdate=addyears(vstartdate,-1)

vpenddate=addyear(venddate,-1)

Not applicable
Author

Thanks a lot, select possible solves my issue.