bigfunctions > translated_month_name
translated_month_name¶
Call or Deploy translated_month_name
?
✅ You can call this translated_month_name
bigfunction directly from your Google Cloud Project (no install required).
- This
translated_month_name
function is deployed inbigfunctions
GCP project in 39 datasets for all of the 39 BigQuery regions. You need to use the dataset in the same region as your datasets (otherwise you may have a function not found error). - Function is public, so it can be called by anyone. Just copy / paste examples below in your BigQuery console. It just works!
- You may prefer to deploy the BigFunction in your own project if you want to build and manage your own catalog of functions. This is particularly useful if you want to create private functions (for example calling your internal APIs). Discover the framework
Public BigFunctions Datasets:
Region | Dataset |
---|---|
eu |
bigfunctions.eu |
us |
bigfunctions.us |
europe-west1 |
bigfunctions.europe_west1 |
asia-east1 |
bigfunctions.asia_east1 |
... | ... |
Description¶
Signature
translated_month_name(date, language)
Description
Get translated_month_name
in targeted language
language
has locale format such as fr
, fr_FR
, fr_BE
, etc.
Examples¶
select bigfunctions.eu.translated_month_name('2022-05-01', 'es')
select bigfunctions.us.translated_month_name('2022-05-01', 'es')
select bigfunctions.europe_west1.translated_month_name('2022-05-01', 'es')
+-----------------------+
| translated_month_name |
+-----------------------+
| mayo |
+-----------------------+
Need help using translated_month_name
?
The community can help! Engage the conversation on Slack
For professional suppport, don't hesitate to chat with us.
Found a bug using translated_month_name
?
If the function does not work as expected, please
- report a bug so that it can be improved.
- or open the discussion with the community on Slack.
For professional suppport, don't hesitate to chat with us.
Use cases¶
A company has a table of sales data with a date column. They want to create a report that displays the month name in different languages based on the user's locale. They can use the translated_month_name
function to achieve this.
Example Scenario:
The company operates in France and Spain. They have a BigQuery table called sales
with columns date
and sales_amount
.
CREATE OR REPLACE TABLE `your_project.your_dataset.sales` AS
SELECT DATE('2023-01-15') AS date, 1200 AS sales_amount UNION ALL
SELECT DATE('2023-02-20') AS date, 1500 AS sales_amount UNION ALL
SELECT DATE('2023-03-10') AS date, 1800 AS sales_amount UNION ALL
SELECT DATE('2023-04-05') AS date, 1100 AS sales_amount;
Query for French Users:
SELECT
bigfunctions.eu.translated_month_name(date, 'fr') AS month_name_fr,
sales_amount
FROM
`your_project.your_dataset.sales`;
Result:
month_name_fr | sales_amount |
---|---|
janvier | 1200 |
février | 1500 |
mars | 1800 |
avril | 1100 |
Query for Spanish Users:
SELECT
bigfunctions.eu.translated_month_name(date, 'es') AS month_name_es,
sales_amount
FROM
`your_project.your_dataset.sales`;
Result:
month_name_es | sales_amount |
---|---|
enero | 1200 |
febrero | 1500 |
marzo | 1800 |
abril | 1100 |
This allows the company to generate reports tailored to different language preferences without needing complex case statements or separate tables for each language. The translated_month_name
function simplifies the process of localizing date information. Remember to replace your_project.your_dataset
and the region prefix (e.g. eu
, us
) as needed.
Spread the word¶
BigFunctions is fully open-source. Help make it a success by spreading the word!