Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  iWay Software Product Forum on Focal Point    [SOLVED] toDate Function in DQS - change return Format
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] toDate Function in DQS - change return Format
 Login/Join
 
Member
posted
When using the toDate function in Data Quality Suite, i am not seeing a way to control the return format. No matter what format you pass into the function ie: toDate('2014.7.14','yyyy.M.d') or toDate('JUL-2014','MMM-yyyy') or toDate('07/14/2014','MM/d/yyyy')

It will always return the date back in the "Day" format of yyyy-MM-dd (ie: 2014-07-14). Is there any way to change this to still return a date, but in the format we prefer?

I am using this in the Column Assigner step, on a field with a datatype of "Day". Maybe that's why i can't control it?

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 7 | Registered: January 02, 2014Reply With QuoteReport This Post
Member
posted Hide Post
ToDate coverts a string to a Date type. To format the output of the Date object use toString(yourDate,'yyyy-MM-dd') to return a String representation -- where the 'yyyy-MM-dd' is using Java's SimpleDateFormat syntax.

See below for details on Java SimpleDateFormat:
http://docs.oracle.com/javase/...impleDateFormat.html

Let me know if this helps..

Sincerely,
Craig Sanders
Integrity Solutions Product Manager - DQS/MDS
Information Builders Inc


all things iWay
 
Posts: 8 | Registered: August 13, 2014Reply With QuoteReport This Post
Member
posted Hide Post
Thanks Craig, its what i suspected, and your reply makes sense. The plan that i created was for a profile, utilizing the Profiling step. I have a field defined as a rollup column and i am passing a string as 'JUL-2014', 'MMM-yyyy' format. The issue i was having was i purposely converted it to a date (using toDate) so that i could order it in my rollup by date. Right now, since its a string, systematically when the fields are rolled up, its in character form and ordered as such in the profile, so 'AUG-2014' comes before 'JUL-2013'. I was trying to think of a creative way to order the strings in date format on a rollup field. If you have any suggestions, please let me know.


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 7 | Registered: January 02, 2014Reply With QuoteReport This Post
Member
posted Hide Post
Try adding an Alter Format where you create a new column.. You can name it whatever you want but in the expression add 'toDate(youStringColumnHere,'MMM-yyyy')'

Now in the profile use this new column instead of your original string date column and it should work.

Let me know how it goes.

Sincerely,
Craig


all things iWay
 
Posts: 8 | Registered: August 13, 2014Reply With QuoteReport This Post
Member
posted Hide Post
The information Craig gave me handled my issue.
[SOLVED]


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 7 | Registered: January 02, 2014Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  iWay Software Product Forum on Focal Point    [SOLVED] toDate Function in DQS - change return Format

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.