
Converting text to a date in Looker Studio can be a game-changer for your data analysis.
You can use the Parse Datetime function to achieve this, which allows you to specify the format of the date in your text field.
The Parse Datetime function is particularly useful for dates in the format 'YYYY-MM-DD', which can be easily parsed into a date object.
By using Parse Datetime, you can avoid manual date conversions and ensure accurate date calculations in your Looker Studio reports.
Converting Text to Date
You can create a valid Date or Date & Time field from your original unrecognized field by creating a new calculated field and using the PARSE_DATE or PARSE_DATETIME function. See the examples below.
To change data types from string to date in Looker Studio, you need to convert the date data field into a date type data type. One way to do this is by creating a calculated field with the formula CAST(date as date).
Additional reading: Looker Studio Calculated Date Field
If you want to change data types without using the CAST function, you can open the target data source, click the arrow on the right side of the type, and select the type you want to change.
Here are some example formulas for converting text to date:
If the field includes time, you can use PARSE_DATETIME instead, like this:
Remember, the format string should match the format of your text data.
Understanding Parse Datetime Function
The PARSE_DATETIME function is a game-changer in data analysis and representation. It converts a string-based date and time representation into a proper date and time format suitable for computation, comparison, and further processing.
Google Data Studio is equipped with this amazing feature. One such feature is the PARSE_DATETIME function, which is useful when there is a need to transform text into a date with time.
To create a valid Date or Date & Time field from your original unrecognized field, you'll need to create a new calculated field. This is where the PARSE_DATE or PARSE_DATETIME function comes in.
Worth a look: Field Editing in Reports Looker Studio
The PARSE_DATETIME function is an indispensable tool in data manipulation and conversion. It's a must-have when working with text-based date and time representations.
By using the PARSE_DATETIME function, you can make your data more usable and easier to work with. This is especially useful when dealing with unrecognized fields that need to be converted into a valid date or date and time format.
Using Parse Datetime Function
The PARSE_DATETIME function is a powerful tool in Looker Studio that allows you to convert text-based date and time formats into a format suitable for computation and comparison. This function is especially useful when working with sales data or any other type of data that includes date and time information in text format.
To use the PARSE_DATETIME function, you need to specify a format string that matches the data in the text column. For example, if your date and time format is "2022-02-24 14:58:30", your format string would be "%Y-%m-%d %H:%M:%S".
Suggestion: Azure Data Factory Convert String to Date

The PARSE_DATETIME function is also case insensitive, so you don't need to worry about the case of the date and time names. For instance, "2022-02-24" and "2022-02-24" would both be recognized as valid date formats.
Here are some examples of format strings that you can use with the PARSE_DATETIME function:
If your field includes the time, you can use the following format strings:
Remember to always ensure that the format string specified matches the data in the text column for successful data conversion.
Data Type Changes
To change the data type of a field in Looker Studio, you can create a calculated field using the PARSE_DATE or PARSE_DATETIME function. This will allow you to convert unrecognized fields into valid Date or Date & Time fields.
One way to do this is to create a new calculated field and use the PARSE_DATE or PARSE_DATETIME function, replacing field with the name of the original unrecognized field. This will give you a valid Date or Date & Time field that can be used in your reports.
Consider reading: Calculated Field Current Month in Looker Studio
Alternatively, you can use the CAST function to change the data type of a field. For example, you can use the formula CAST(date as date) to convert a date data field into a date type data type.
If you're using Looker Studio and the data is imported as text type, you'll need to convert it to a date type to perform actions specific to date data, such as filtering by period. You can do this by creating a calculated field and using the CAST function.
To change the data type without using the CAST function, you can open the target data source and click the arrow on the right side of the type. This will display candidates for the type to change, and you can select the new type you want to change it to.
Intriguing read: Change Page Name Looker Studio
Sources
- https://support.google.com/looker-studio/answer/10309432
- https://88studio.io/blogs/blog/looker-studio-cast
- https://www.catchr.io/university/looker-studio-course/transforming-text-into-date-and-time-introducing-the-parse-datetime-function-in-looker-studio
- https://stackoverflow.com/questions/75156017/how-to-convert-text-type-to-date-type-in-google-data-studio
- https://www.catchr.io/university/looker-studio-course/transform-you-data-with-the-cast-function-in-looker-studio
Featured Images: pexels.com