Convert Date(yyyy,mm,dd) to a date field
My work has had me creating a pipeline for the last few weeks, that checks if an excel document exists, and if it does, it opens it and updates our system based on what dates are in the spreadsheet. I’ve had to develop it using the template we received, which had no data on it, so I filled in some test cases so that I cold work. I filled in the dates as DD/MM/YYYY since I assumed they would come in a similar format. Yesterday, I received a copy of the document, and the dates are not in a date format. They are an excel formula: “=DATE(yyyy,mm,dd)” Which is coming through to SnapLogic as an string, and the Date.parse() can’t process it The only thing I can think of is sub-stringing, but I don’t like doing it that way. Can anyone suggest a better method of doing this? Thanks Regards RoySolved3.4KViews0likes2CommentsNeed to convert yyyymmdd to yyyy-mm-dd
Hi, I have a element as:- jsonPath($, “$Z_ORD.IDOC.DK02[].DATE") and value is coming as 20210521(yyyymmdd). I need to convert it to 2021-05-21 and map it to target ml element. I am using mapper. Tried like below:- Date.parse(jsonPath($, "$Z_ORD.IDOC.DK02[].DATE”,“yyyMMdd”)).toLocaleDateTimeString({“format”:“yyyy-MM-dd”}) || null but getting error as:- Not-a-number (NaN) does not have a method named: toLocaleDateTimeString, found in: …:“yyyy-MM-dd”}). Perhaps you meant: toString, toExponential, toPrecision, toFixedSolved8.4KViews0likes7CommentsCan't apply date functions to a date column
Hello, I get “Unknown method” when applying any date-related snaplogic function to a column that is a local-date-time. I tried this with two separate clients with different schemas and data types, still same issue. Is this a bug?Solved2.4KViews0likes1CommentDate.Parse() Function
I have an incoming file that has a date value of 00:00.00.000 as a value. I am trying to set it to null. Comparing the exit_date ==‘00:00:00.000’ fails. Checking Date.parse($exit_date)==’ ’ or Date.parse($exit_date==null fails. Date.parse($exit_date).ToLocalDateString() fails. Not sure how I can parse this data. Any ideas on how to map this value to null?SolvedCannot format date correctly to YYYY-MM-DD
Hi there, I’ve looked at other articles addressing this but non has helped me so far. Im looking to format a date in the DD/MM/YYYY to YYYY-MM-DD. The date will always be populated. I’ve tried the following expressions but they wont process correctly Date.parse($original[‘Due Date’], “yyyy MM dd”) LocalDate.parse($original[‘Due Date’],“yyyy/MM/dd”) If I use the above expression and if the date is 06/04/2021, the output date becomes 0006-04-18. It’s inexplicable.12KViews0likes12CommentsDate Filter for loading Excel File
I am trying to filter an excel file from a folder based on date to load onto a database. I have successfully managed to get the filter snap to filter out all months other than current month with the filter code as below, Date.parse($[‘Update date’]).getMonth()==Date.now().getMonth() The problem now is i have multiple files for the current month and would like to filter out further to the max of the dates and hence get only one file everytime (currently the above code gets me 2 or more based on current months files). Thanks for you help.Solved5KViews0likes4CommentsDates to BigQuery problem
I’m trying to export some dates into BigQuery, but even though the preview of the data that is being sent to BigQuery is correct, when I check my table in BigQuery it always shows as null. Any idea on how to solve this? My data is parsed this way: Date.parse($ACCT_STATUS_DATE.Date,“yyyy-MM-dd”)1.8KViews0likes0Comments