A função power avalia um base elevando-o à potência de um exponent específico.
Exemplos
A função power pode ser usada para elevar um número à potência de outro. Por exemplo, 23 seria escrito como:
power(2, 3)
Normalmente, a função power é usada com uma referência de campo ou uma expressão.
Exemplo:
power(${order_item.standard_deviation_profit},2)
Informações úteis
A função power também pode ser usada para extrair a raiz n-ésima de um número usando 1/n como exponent. Por exemplo, a raiz cúbica (a terceira raiz) de 7 seria:
power(7, 1/3)
Para uma raiz quadrada (a segunda raiz), use a função sqrt.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-08-25 UTC."],[],[],null,["# power\n\nThe `power` function can be used in [custom filters](/looker/docs/filtering-and-limiting#custom-filters) and [table calculations](/looker/docs/table-calculations) to raise a number to the power of a given exponent.\n\nSyntax\n------\n\n**`power(base, exponent)`**\n\nThe `power` function evaluates a `base` by raising it to the power of a given `exponent`.\n\nExamples\n--------\n\nThe `power` function can be used to raise a number to the power of another number. For example, 2^3^ would be written as: \n\n power(2, 3)\n\nTypically, the `power` function is used with a field reference or an expression.\nFor example: \n\n power(${order_item.standard_deviation_profit}, 2)\n\nThings to know\n--------------\n\nThe `power` function can also be used to take the nth root of a number by using 1/n as the `exponent`. For example, the cube root (the 3rd root) of 7 would be: \n\n power(7, 1/3)\n\nFor a square root (the 2nd root) just use the `sqrt` function."]]