Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Die Funktion pivot_where kann in einer Tabellenkalkulation verwendet werden, um eine Pivot-Spalte anhand einer Bedingung auszuwählen.
Syntax
pivot_where(select_expression, expression)
Die Funktion pivot_where gibt den Wert von expression für die Pivot-Spalte zurück, die eindeutig select_expression oder null erfüllt, oder „Null“, wenn eine solche Spalte nicht vorhanden oder nicht eindeutig ist.
Beispiele
Im folgenden Beispiel suchen wir nach der Pivot-Spalte, die auf „Bestellstatus“ basiert und den Wert „ausstehend“ hat. Wenn wir es finden, geben Sie in dieser Zelle „Bestellmenge“ zurück:
[[["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-07-30 (UTC)."],[],[],null,["# pivot_where Function\n\nThe `pivot_where` function can be used in a [table calculation](/looker/docs/table-calculations) to select a pivot column by a condition.\n\nSyntax\n------\n\n**`pivot_where(select_expression, expression)`**\n\nThe `pivot_where` function returns the value of `expression` for the pivot column which uniquely\nsatisfies `select_expression` or `null` if such a column does not exist or is not unique.\n\nExamples\n--------\n\nIn the following example we look for the pivot column that is based on \"Order Status\", and has a value of \"pending\". If we find it, return the \"Order Count\" in that cell: \n\n pivot_where(${orders.status} = \"pending\", ${orders.count})\n\nThings to know\n--------------\n\n1. If there is *exactly* one pivot column where `select_expression` is true, the `expression` is returned. Otherwise the `expression` returns NULL.\n\n2. `pivot_where` cannot be used in a [custom filter](/looker/docs/filtering-and-limiting#custom-filters)."]]