Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
jduenyas
Specialist
Specialist

Actions in a button

Hello all:

On a sheet I have 2 buttons with 2 actions each.

The first button has 2 actions
       A) Clear All --  (This clears the sheet from any pre-existing selections anywhere)   and followed by
       B) Select In Field set for Year and Search String is set to  =Year(today())  (This selects the current year)
This works fine no matter what selections are present in the sheet. Eveything is cleared out and the current year is selected.

The second button has 2 actions
      A) Clear All --  and followed by
      B) Select In Field is set for MonthYear (this is a field in my calendar in the form of Mmm YYYY like Sep 2015). 
            In the Search String I have this Concat function:
          = '("' & Concat( DISTINCT  If(MonthYear>=MonthName(AddMonths(Today(),-12))  AND  MonthYear<=MonthName(AddMonths(Today(),-1)), MonthYear) , '"|"' , MonthYear)  & '")'

This selects the last 12 rolling months

And here are the problems:

--- If there is nothing pre-selected anywhere on the sheet, it works just fine. But if there is a month (or a group of months) already selected they are NOT cleared by the Clear All action in A.
--- If there is anything else pre-selected in the sheet, other than month(s), everything will be cleared out but it will require a second click to then select the 12 rolling months.

Does anyone know why is that? Is there a way to activate the button and dynamically select 12 rolling months?

(*** Note  -  My calendar contains dates also into the future (next 12 months) for forcasting purposes. The action of the first button described above selects the current year and ALL months of the year Jan - Dec are associated. The action of the second button described selects specifically just the 12 rolling months.
Also, the delimiter between the MonthYear values is set to " (double quotation mark (chr(34)) on either side of the Pipe. If setting to other delimiter such as Asterisk or no delimiter, it does not work at all )

As usual, your help is appreciated.

Thanks

Josh

13 Replies
jduenyas
Specialist
Specialist
Author

Here it is attached.

---If you clear everything and then click the button 12 months will be selected.

---If you select one or more of the selected months in the MonthYear list box and click the button nothing will happen.

---If you Clear All (With the Menu Clear button), select a month or 2 and then click the button, the selection will be cleared and require a second click to select the 12 months.

The Clear All does not seem to work or the Concat functions does not refresh the selection.

Thanks Massimo

jduenyas
Specialist
Specialist
Author

I have resolved the problem:

The previous Concat function was:

='("'& Concat(DISTINCT  if(MonthYear>=MonthName(AddMonths(today(),-12)) AND MonthYear<=MonthName(AddMonths(today(),-1)),MonthYear),'"|"',MonthYear) &'")'

I have added the {1} selection into it and now it works:

'("'& Concat(DISTINCT {1} if(MonthYear>=MonthName(AddMonths(today(),-12)) AND MonthYear<=MonthName(AddMonths(today(),-1)),MonthYear),'"|"',MonthYear) &'")'

Thank you all for investigating that.

Josh

evan_kurowski
Specialist
Specialist

Hello Josh,

Here is a variation that allows a sliding selection of the starting point of the 12-month window (while forcing all selections of future ranges to start from the present)

jduenyas
Specialist
Specialist
Author

I like it!

Thanks Evan