Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
YEARWEEK
Gibt das Jahr und die Woche für ein bestimmtes Datum zurück.
Verwendungsbeispiel
YEARWEEK(Date)
Syntax
Mit der folgenden Syntax werden das Jahr und die Wochennummer aus einem Datumswert zurückgegeben.
YEARWEEK( date_expression )
Mit der folgenden Syntax werden das Jahr und die Wochennummer eines Werts vom Typ „Datum“ im Kompatibilitätsmodus zurückgegeben.
YEARWEEK( X [, format_string ])
Parameter
date_expression: Ein Feld oder Ausdruck vom Typ „Datum“ oder „Datum und Uhrzeit“.
X: Ein Feld oder Ausdruck, das bzw. der als Text, Zahl oder Datum im Kompatibilitätsmodus ausgewertet wird.
format_string: Format für X. Optional, wenn X korrekt als semantisches Feld vom Typ „Datum“ konfiguriert ist.
Strings für Daten im Kompatibilitätsmodus formatieren
Die unterstützten Datumsfunktionen akzeptieren die folgenden Eingabeformate, wenn X ein Feld oder Ausdruck vom Typ „Text“ ist oder wenn sie im Kompatibilitätsmodus eingegeben werden:
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-03 (UTC)."],[],[],null,["YEARWEEK\n========\n\nReturns the year and week number of a given date.\n\nSample usage\n------------\n\n`YEARWEEK(Date)`\n\nSyntax\n------\n\nThe following syntaxe turns the year and week number from a Date value.\n\n`YEARWEEK( `\u003cvar translate=\"no\"\u003edate_expression\u003c/var\u003e` )`\n\nThe following syntax returns the year and week number from a compatibility mode Date value.\n\n`YEARWEEK( `\u003cvar translate=\"no\"\u003eX\u003c/var\u003e` [, `\u003cvar translate=\"no\"\u003eformat_string\u003c/var\u003e` ])`\n\n### Parameters\n\n- \u003cvar translate=\"no\"\u003edate_expression\u003c/var\u003e - a Date or Date \\& Time field or expression.\n- \u003cvar translate=\"no\"\u003eX\u003c/var\u003e - a field or expression that evaluates to Text, Number, or compatibility mode Date.\n- \u003cvar translate=\"no\"\u003eformat_string\u003c/var\u003e - format for \u003cvar translate=\"no\"\u003eX\u003c/var\u003e. Optional if \u003cvar translate=\"no\"\u003eX\u003c/var\u003e is correctly configured as a semantic date field.\n\n#### Format strings for compatibility mode dates\n\nSupported date functions accept the following input formats if `X` is a Text field or expression, or compatibility mode Date:\n\n- `BASIC`: %Y/%m/%d-%H:%M:%S\n- `DEFAULT_DASH`: %Y-%m-%d \\[%H:%M:%S\\]\n- `DEFAULT_SLASH`: %Y/%m/%d \\[%H:%M:%S\\]\n- `DEFAULT_DECIMAL`: %Y%m%d \\[%H:%M:%S\\]\n- `RFC_1123`: for example, Sat, 24 May 2008 20:09:47 GMT\n- `RFC_3339`: for example, 2008-05-24T20:09:47Z\n- `DECIMAL_DATE`: same as `DEFAULT_DECIMAL`\n\nAny valid [strptime](http://pubs.opengroup.org/onlinepubs/009695399/functions/strptime.html) format is accepted.\n\nSupported time functions accept the following input format if `X` is a Number field or expression:\n\n- `SECONDS`: seconds since Epoch\n- `MILLIS`: milliseconds since Epoch\n- `MICROS`: microseconds since Epoch\n- `NANOS`: nanoseconds since Epoch\n- `JULIAN_DATE`: days since Epoch\n\nExamples\n--------\n\nNotes\n-----\n\nThis function works with both compatibility mode dates and [upgraded Date and Date \\& Time](/looker/docs/studio/dates-and-times) data types.\n\nRelated resources\n-----------------\n\n- [Dates and times](/looker/docs/studio/dates-and-times)\n- [About calculated fields](/looker/docs/studio/about-calculated-fields)\n- [Looker Studio function list](/looker/docs/studio/function-list)"]]