Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Previous months selection in current year...

The expressions are not giving the desired results.

=vMaxYear returns the current month ie. 2013 and now i would want all the months selected suppose the current month is July. So essentially when i open the document the 2013 and months Jan,Feb,Mar,April,May,June and July should all be selected

Thanks

Kwame

5 Replies
Anonymous
Not applicable
Author

Kwame,

This action works for me (I have to mention that my Month field is dual):

Action -  select in field

Field - Month

Search string -

= '>=' & min({<Year={"$(=year(today()))"}>} Month) & '<=' & only({<Date={"$(=date(today()))"}>} Month)

Regards,

Michael

Anonymous
Not applicable
Author

Hi!

It returns all the possible values in the field ie It selects all the month names

Anonymous
Not applicable
Author

Do you have fields Month, Year, Date in your data model?  Is Month field dual (or at least numeric)?

If you can upload you application or a sample, it would be easier to help...

Anonymous
Not applicable
Author

Yes I have all these fields and importantly the month field displays just 3 abbreviated characters not dual and numberic eg Jan,Feb,Mar.

Below is the sample script of the calendar

CALENDER:

LOAD *,

Quarter&'-'&Year AS QuarterYear

;

LOAD

DATE(TempDate,'dd/MM/yyyy') AS Date,   

Year(TempDate) AS Year,

'Q' & ceil(month(TempDate) / 3) AS Quarter,

date(monthstart(TempDate), 'MMM-YYYY') AS MonthYear,

Day(TempDate)AS Day,

Week(TempDate) AS Week,

Month(TempDate) AS Month

RESIDENT TEMP_CALENDER

ORDER BY TempDate Asc;

Drop table TEMP_CALENDER;

Thanks

Anonymous
Not applicable
Author

Looks reasonable.  I expect my search string to work if you replace Month with MonthYear (unless you want to select January - July for all years):

Action -  select in field

Field - MonthYear

Search string -

= '>=' & min({<Year={"$(=year(today()))"}>} MonthYear) & '<=' & only({<Date={"$(=date(today()))"}>} MonthYear)