translated_weekday_name¶
translated_weekday_name(date, language)
Description¶
Get translated_weekday_name
in targeted language
language
has locale format such as fr
, fr_FR
, fr_BE
, etc.
Examples¶
Call or Deploy translated_weekday_name
?
Call translated_weekday_name
directly
The easiest way to use bigfunctions
translated_weekday_name
function is deployed in 39 public datasets for all of the 39 BigQuery regions.- It can be called by anyone. Just copy / paste examples below in your BigQuery console. It just works!
- (You need to use the dataset in the same region as your datasets otherwise you may have a function not found error)
Public BigFunctions Datasets
Region | Dataset |
---|---|
eu |
bigfunctions.eu |
us |
bigfunctions.us |
europe-west1 |
bigfunctions.europe_west1 |
asia-east1 |
bigfunctions.asia_east1 |
... | ... |
Deploy translated_weekday_name
in your project
Why deploy?
- You may prefer to deploy
translated_weekday_name
in your own project 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).
- Get started by reading the framework page
Deployment
translated_weekday_name
function can be deployed with:
pip install bigfunctions
bigfun get translated_weekday_name
bigfun deploy translated_weekday_name
select bigfunctions.eu.translated_weekday_name('2023-06-02', 'fr')
select bigfunctions.us.translated_weekday_name('2023-06-02', 'fr')
select bigfunctions.europe_west1.translated_weekday_name('2023-06-02', 'fr')
+-------------------------+
| translated_weekday_name |
+-------------------------+
| vendredi |
+-------------------------+
Need help or Found a bug using translated_weekday_name
?
Get help using translated_weekday_name
The community can help! Engage the conversation on Slack
We also provide professional suppport.
Report a bug about translated_weekday_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.
We also provide professional suppport.
Use cases¶
A company has a database of customer orders with timestamps. They want to generate reports based on the day of the week, but need the reports to be localized for different regions.
For example, they might want to generate a report showing the total sales for each day of the week in French for their French-speaking customers, and a separate report in Spanish for their Spanish-speaking customers.
Using the translated_weekday_name
function, they can achieve this easily. They can query their order data, extract the weekday from the timestamp, and then use the function to translate the weekday name into the desired language. A simplified example in BigQuery SQL (assuming the dataset is in the EU region) would be:
SELECT
bigfunctions.eu.translated_weekday_name(EXTRACT(DATE from order_timestamp), 'fr') AS french_weekday,
SUM(order_total) AS total_sales
FROM
`your_project.your_dataset.your_orders_table`
GROUP BY 1
ORDER BY 1
This would output a table showing the total sales for each day of the week, with the weekday name translated into French. They could then repeat the query with a different language code (e.g., 'es' for Spanish) to generate a localized report for a different region.
Spread the word!¶
BigFunctions is fully open-source. Help make it a success by spreading the word!