May I have some date field help, replace year with current year? - netsuite

I have a date field custentity_autopayprocessingdate whose value is 11/16/2021.
I have an invoice date field custbody_inv_processdate and I would like the value of the invoice date field to be: Current Month, Day from custentity_autopayprocessingdate, and current year
What's the best way to achieve this, so far I cannot do it outside of a search?
Options:
Replace custentity_autopayprocessingdate with an integer limited to 28 (Feb) and calculate date on invoice create
Calculate through workflow or suitescript and set
Search Formulas (working but only in search context - transaction search mainline)
/*Workflow 35 Value*/to_date(To_Char({customermain.custentity_autopayprocessingdate},'MM/dd/')||to_Char({today},'yyyy'),'MM/dd/yyyy')
/*Extract Workflow Option*/To_Date(EXTRACT(MONTH FROM {customermain.custentity_autopayprocessingdate})||'/'||EXTRACT(DAY FROM {customermain.custentity_autopayprocessingdate})||'/'||EXTRACT(YEAR FROM {today}),'MM/dd/yyyy')
/*To Char 2*/To_Char({customermain.custentity_autopayprocessingdate},'MM/dd')||'/'||To_Char({today},'yyyy')

Related

Trouble converting a text string to date in Notion

I'm trying to convert a text string into a date in Notion to build a birthday reminder system in my database.
Bigger picture, I want a database view with the birthdays that are coming up in the next month. Some people I know their actual date of birth, and for others I only know their birthday. I enter the birthdate for the people whose birth year I don't know as the current year.
The filters allow you to select a date relative to the present, but not a date whose anniversary is coming up. So to fix this, I am creating a field that reformats the birthdate as a date in the current year, and filtering based on that.
I successfully built the new date, but it is a text string. In order for the filters to work, it needs to be formatted as a date.
I tried formatDate but that gives me an error.
For example:
formatDate(concat(prop("Birthday"), ", ", prop("thisYear")), "MMMM D YYYY")
Gives error:
Type mismatch concat(prop("Birthday"), ", ", prop("thisYear")) is not a Date.
It appears formatDate only reformats an existing date, it doesn't convert a string into a date. I can't find a function that converts a string into a date. How would one do that?
to convert the date you have in text format into a prop date, you have to start from 01 Jan 1970, this is the date Notion use to refer every single date into ms.
With this formula you will have 01 Jan 1970 from now:
dateAdd(dateSubtract(dateSubtract(dateSubtract(dateSubtract(dateSubtract(now(),
year(now()) - 1970, "years"), month(now()), "months"), date(now()),
"days"), hour(now()), "hours"), minute(now()), "minutes"), 1, "days")
Now you have to add to this date months, year and days you have into your birthday prop.
To do this you simply have to use he dateAdd formula, so you will have:
dateAdd(dateAdd(dateAdd(dateSubtract(dateSubtract(dateSubtract(dateSubtract(dateSubtract(now(),
year(now()) - 1970, "years"), month(now()), "months"), date(now()),
"days"), hour(now()), "hours"), minute(now()), "minutes"),
prop("Giorni"), "days"), prop("Mese") - 1, "months"), prop("Anno") -
1970, "years")
You have to consider that in my example, prop("Giorni"), prop("Mese") and prop("Anno") are already numbers.
If you have them into a text field you first have to extract them with the slice formula and convert them into number with toNumber formula.
I hope I helped you, sorry for my English but I'm not native English speaker.
Bye

Netsuite compare 2 datetime in saved search criteria

I would like to send an email if my URL is expired.
For that, I have created a saved search and a custom transaction field.
My goal is to show the transaction record in the saved search, from the moment the date is expired.
I tried with formula date but it return only if the date is before today. But it can happen that we are the same day and that the url is expired for 1min or 1hour.
Ex: Today = 13/09/2022 3:00 pm and expiration date is 13/09/2022 2:59 pm
So I tried with Formula numeric to do:
{customfield} - {today} is less than 0
But Netsuite return an unknown error.
So I tried:
TO_CHAR((NVL({customfield},{today})-{today})) is less than zero
But it return this kind of value so it's always zero
+000000000 20:57:33.000000
or
-000000000 02:26:33.000000
or
+000000000 00:00:00.000000
How can I do to send an email when the DateTime from my custom field is in the past?
The formula type you select specifies the data type for the result returned. When you select "Formula (Date)" (formuladate) or "Formula (Date/Time)" (formuladatetime), NetSuite will convert the returned difference into a time interval formatted as a date or timestamp. For numerical comparison, use "Formula (Numeric)" (formulanumeric) instead.

end of month/year data in tibco spotfire

I have the following dataset in tibco spotfire:
Original data
I want to bring the amount of item in the beginning of each month for each row and get the following result:
Image
Any suggestions?
The dataset looks like this: I have got maximum amount for previous month, but I want to get the amount of the last day of the previous month.
enter image description here
I could do it via an intermediate column (as Spotfire's OVER does not accept expressions).
First calculate the year and month like this:
(assuming the format of your date is known and stable)
[YearMonth] is :
Integer(Concatenate(Substring(String([Date]),7,4),Substring(String([Date]),4,2)))
then your [Previous Month] is:
Max([Amount]) over (Intersect(Previous([YearMonth]),[BRANCH],[CLASS]))
and your [Diff] is:
[Amount] - [Previous Month]
Revised after comment 19 August:
change the Max to ValueForMax and insert the day of the month, so that the formula calculates the value
corresponding to the last recorded day for that month:
ValueForMax(DayOfMonth([Date]),[Amount]) over (Intersect(Previous([YearMonth]),[BRANCH],[CLASS]))
Revised after comments 6 October:
if Substring(..) is not available, here is an alternative solution:
Create a new column (to make the expressions understandable): [StringMonth] as:
If(LongInteger(Month([Date]))>10,String(LongInteger(Month([Date]))), Concatenate('0',String(LongInteger(Month([Date])))))
Then calculate your [YearMonth] as:
Integer(Concatenate(Year([Date]),[StringMonth]))

Excel2016 - Excelformula - Return a date which is not referenced as a Saturday & Sunday

I am looking to return the date (deadline) into a cell sheet which is not on a Sat and/or Sun. So for example, if the starting date is Monday 04/09/2017 and we need 6 days to complete the work, I want the deadline to says Monday 11/09/2017.
The response from User91504 will solve your issue, I will just add to use something like this in your case
=WORKDAY(J13,6)-1
As the formula is taking the current day into account as part of the leadtime, otherwise it will provide 12/09/2017 as result
=WORKDAY(your start date , number of days to add)
If your date was in Cell J13, then:
=WORKDAY(J13,6)
Or if you manually type the date, use DATE function:
=WORKDAY(DATE(2017,9,4),6)

CALM Query to get a specifc day and month from any year

I'd like to create a CALM query to get days and months of any year. Example:
In a list with the results below, I'd like to get all dates that have day equals 10 and month equals 07:
07/10/1984
01/02/2001
05/12/1991
07/10/2007
So, the result would be:
07/10/1984
07/10/2007
I don't think you will be able to do it directly in CAML for any year so you would end up listing out that day and month range for every year - bit of a monster.
Are you able to add extra calculated columns to your list? If so then you can add
DayAndMonth = Day([YourDate]) & "-" & Month([YourDate])
Then its a simple case of filtering using CAML or normal view filter (assuming US date format)
DayAndMonth = "7-10"

Resources