Test if a specific month is selected then do something

Highlighted
New Contributor

Test if a specific month is selected then do something

Hello,

 

I have a module,and within it I use Time as a Page selector in it. 

My time is formatted like this : Calendar Type : Calendar Months/Quarters/Years, Fiscal Year Start Month: Jan, Current FY : 1 Jan 2018 - 31 Dec 2018. 

 

For a specific line item in my module I want to test something like this : IF Jun is selected THEN do a 1st instruction ELSE IF Dec is selected then do a 2nd instruction ELSE BLANK .

 

My problem is that I don't know how to test if Jun or Dec is selected from pages, instead of other months. 

 

I tried something like this : 

  • IF MONTH(TIME.'Jun 18') THEN 
  • IF ITEM(Time) = Time.Jun THEN 

None of them worked. Please help me!

 

Thank you & best regards

5 REPLIES 5
Highlighted
Master Anaplanner/Community Boss

Re: Test if a specific month is selected then do something

@ankiutel

You won't be able to do that kind of check

However, you can create a line item that is formatted as a time period (Months) and publish that to the dashboard.  Then you can check that line item using the IF ITEM(TIME) = Selection module.Choose month

 

If you need the use to only select certain months (so either Jun or Dec), you'll need to create a list with those two members, create a module by that list with a line item that is formatted by month. 

the the check will something like:

IF ITEM(TIME)= Choose months.Month[LOOKUP:selection module.Choose month]

 

I hope that helps

David

 

Highlighted
New Contributor

Re: Test if a specific month is selected then do something

Thank you, @DavidSmith, for me it didn't work this, instead I think I found another idea, but it is still in testing.

 

Have a nice day, 

Ankiutel

Highlighted
Occasional Contributor

Re: Test if a specific month is selected then do something

Hi Ankiutel,

 

if your idea tested and worked, please share it here. As I am also looking for this kind of solution.

 

Thanks,

Geet.

Highlighted
New Contributor

Re: Test if a specific month is selected then do something

Hello,

 

Try:

IF MONTH(START()) = 7 THEN 1 ELSE IF MONTH(START()) = 12 THEN 2 ELSE 0 

 

Rick

Highlighted
Master Anaplanner/Community Boss

Re: Test if a specific month is selected then do something

HI,

Your above mentioned formula should work, but you didn't follow the syntax. Please find the screen shot below.Test if a specific month is selected then do something.PNG

But however it is not a permanent solution because if it goes to next year then you have to rewrite the formula. The best proactice is to find the month using below logic.Test if a specific month is selected then do something 1.PNG

 

Test if a specific month is selected then do something 2.PNG

 

This way you can achieve the solution irrespective of the years selected.

 

Hope this would help you!!

 

Thanks,

kavin

 

 

 

Regards,
Kavin.