0

I would like to pass current year( ["current Year"]) and current month ( ["current month"]) as the dynamic value for month and year instead of the hard coded value . Please let me know how I will able to pass the string year and month to the filter.

q= load "plan";
q=filter q by 'Type__c'  =="Renewal";
q= filter q by 'Plan.Name' == "2018";
q= filter q by 'inMonth' == "12";
1
  • when I tried to convert the numeric to string using the function number_to_string('month_in_number',"##")=date_to_string(now(), "MM"); , it is giving me FUNC instead of IDTOKEN Error . Any thoughts ?
    – Manoj
    Dec 11, 2018 at 18:51

1 Answer 1

0

You can use date_to_string to get a specific part of a date. If you use now() it will give you the requested part of the current date. For example:

q= load "plan";
q=filter q by 'Type__c'  =="Renewal";
q= filter q by 'Plan.Name' == date_to_string(now(), "yyyy");
q= filter q by 'inMonth' == date_to_string(now(), "MM");

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .