- Deprecated function: Use of "static" in callables is deprecated in Drupal\user\Entity\Role::postLoad() (line 172 of core/modules/user/src/Entity/Role.php).
Drupal\user\Entity\Role::postLoad(Object, Array) (Line: 423)
Drupal\Core\Entity\EntityStorageBase->postLoad(Array) (Line: 353)
Drupal\Core\Entity\EntityStorageBase->loadMultiple(Array) (Line: 16)
Drupal\user\RoleStorage->isPermissionInRoles('access site in maintenance mode', Array) (Line: 112)
Drupal\Core\Session\UserSession->hasPermission('access site in maintenance mode') (Line: 105)
Drupal\Core\Session\AccountProxy->hasPermission('access site in maintenance mode') (Line: 83)
Drupal\redirect\RedirectChecker->canRedirect(Object) (Line: 120)
Drupal\redirect\EventSubscriber\RedirectRequestSubscriber->onKernelRequestCheckRedirect(Object, 'kernel.request', Object)
call_user_func(Array, Object, 'kernel.request', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.request') (Line: 145)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191)
Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 713)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
- Deprecated function: Creation of dynamic property Drupal\mysql\Driver\Database\mysql\Select::$alterMetaData is deprecated in Drupal\Core\Database\Query\Select->addMetaData() (line 178 of core/lib/Drupal/Core/Database/Query/Select.php).
Drupal\Core\Database\Query\Select->addMetaData('entity_type', 'file') (Line: 115)
Drupal\Core\Entity\Query\Sql\Query->prepare() (Line: 80)
Drupal\Core\Entity\Query\Sql\Query->execute() (Line: 640)
Drupal\Core\Entity\EntityStorageBase->loadByProperties(Array) (Line: 63)
Drupal\Core\Entity\EntityRepository->loadEntityByUuid('file', 'e2427ade-b4f5-48a7-8e40-c15a17b8bb68') (Line: 95)
Drupal\editor\Plugin\Filter\EditorFileReference->process('Now suppose that in the <em>Country</em> field of the <em>Geography</em> table we have the country in which the reseller who made each sale is located. Let's look at sales by country first. For this we simply take the measure that adds the sales (<em>Sales</em>) and the <em>Country</em> field to a table type display:
The <em>Sales</em> measure is summing the field that contains the sales figure, <em>SalesAmount</em>:
Sales = SUM(Sales[SalesAmount])
Now suppose that we want to be able to analyze sales in all countries other than the United States. A first option would be to use the <a href="/en/dax/function/calculate">CALCULATE</a> function to revalue the <em>Sales</em> measure:
Non USA sales = CALCULATE([Sales], Geography[Country] <> "United States")
We can take this new measure to a card type display to see the result:
The figure is correct, but if we take this measure to a table together with the <em>Country</em> field to show sales outside the United States segmented by country, the result is the following:
Of course, this is not what we wanted, but the CALCULATE function is modifying the context to always consider all countries other than the United States.
What we want is to be able to use the <em>SalesAmount</em> field that contains the sales figure but including only those sales records that do not correspond to resellers located in the United States. To begin with, we can build this table that only considers the countries of interest using the <a href="/en/dax/function/filter">FILTER</a> function. The pseudocode would be something like:
Filtered table = FILTER(
Sales,
Countries other than the United States
)
If the <em>Sales</em> table included a "<em>Country</em>" field, it would be enough to add <em>Country <> "United States"</em> instead of "<em>Countries other than the United States</em>", but it does not include it. This information relative to the country in which the reseller is located is in another table, the aforementioned <em>Geography</em> table, a table that is not directly accessible as an argument of the FILTER function. It is in this situation that the RELATED function comes in handy. Assuming that there is a relationship (of many-to-one or one-to-one type) between the sales table and the geography table, we can access from the first to the <em>Country</em> column of the second with the expression:
RELATED(Geography[Country])
Now the code for the filtered table would be as follows:
Filtered table = FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
)
As mentioned, the RELATED function requires a row context, which we can achieve using a table scan function like <a href="/en/dax/function/sumx">SUMX</a>, which is exactly what we are looking for to calculate total sales:
Sales non USA =
SUMX(
FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
),
Sales[SalesAmount]
)
What we are doing is adding the <em>SalesAmount</em> field for each of the rows of the filtered table, and this is composed of the set of sales records that do not have the United States associated as a country, but without excluding other possible filters that come given by the context.
In this way, if we take this measure to a card:
...we see that the total is correct. And if we take it to a table together with the <em>Country</em> field of <em>Geography</em>:
...we see that the measure is correctly adapted to the context, just as we wanted.
', 'en') (Line: 118)
Drupal\filter\Element\ProcessedText::preRenderText(Array)
call_user_func_array(Array, Array) (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 788)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 374)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 125)
__TwigTemplate_a7d6005c89ae729617b9a0c2bccb1776->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 46)
__TwigTemplate_804f7948456cfe20e11a34c43439c7c2->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 43)
__TwigTemplate_c80c0b77898c75587c022d0756404fc4->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/contrib/classy/templates/field/field--text-long.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('field', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 446)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 74)
__TwigTemplate_94047fbdba6937b76a4479dfa1763452->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/custom/yg_aesthetic/templates/node.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('node', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 242)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 235)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 132)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 174)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191)
Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 713)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
- Deprecated function: Creation of dynamic property Drupal\mysql\Driver\Database\mysql\Select::$alterTags is deprecated in Drupal\Core\Database\Query\Select->addTag() (line 149 of core/lib/Drupal/Core/Database/Query/Select.php).
Drupal\Core\Database\Query\Select->addTag('entity_query') (Line: 147)
Drupal\Core\Entity\Query\Sql\Query->prepare() (Line: 80)
Drupal\Core\Entity\Query\Sql\Query->execute() (Line: 640)
Drupal\Core\Entity\EntityStorageBase->loadByProperties(Array) (Line: 63)
Drupal\Core\Entity\EntityRepository->loadEntityByUuid('file', 'e2427ade-b4f5-48a7-8e40-c15a17b8bb68') (Line: 95)
Drupal\editor\Plugin\Filter\EditorFileReference->process('Now suppose that in the <em>Country</em> field of the <em>Geography</em> table we have the country in which the reseller who made each sale is located. Let's look at sales by country first. For this we simply take the measure that adds the sales (<em>Sales</em>) and the <em>Country</em> field to a table type display:
The <em>Sales</em> measure is summing the field that contains the sales figure, <em>SalesAmount</em>:
Sales = SUM(Sales[SalesAmount])
Now suppose that we want to be able to analyze sales in all countries other than the United States. A first option would be to use the <a href="/en/dax/function/calculate">CALCULATE</a> function to revalue the <em>Sales</em> measure:
Non USA sales = CALCULATE([Sales], Geography[Country] <> "United States")
We can take this new measure to a card type display to see the result:
The figure is correct, but if we take this measure to a table together with the <em>Country</em> field to show sales outside the United States segmented by country, the result is the following:
Of course, this is not what we wanted, but the CALCULATE function is modifying the context to always consider all countries other than the United States.
What we want is to be able to use the <em>SalesAmount</em> field that contains the sales figure but including only those sales records that do not correspond to resellers located in the United States. To begin with, we can build this table that only considers the countries of interest using the <a href="/en/dax/function/filter">FILTER</a> function. The pseudocode would be something like:
Filtered table = FILTER(
Sales,
Countries other than the United States
)
If the <em>Sales</em> table included a "<em>Country</em>" field, it would be enough to add <em>Country <> "United States"</em> instead of "<em>Countries other than the United States</em>", but it does not include it. This information relative to the country in which the reseller is located is in another table, the aforementioned <em>Geography</em> table, a table that is not directly accessible as an argument of the FILTER function. It is in this situation that the RELATED function comes in handy. Assuming that there is a relationship (of many-to-one or one-to-one type) between the sales table and the geography table, we can access from the first to the <em>Country</em> column of the second with the expression:
RELATED(Geography[Country])
Now the code for the filtered table would be as follows:
Filtered table = FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
)
As mentioned, the RELATED function requires a row context, which we can achieve using a table scan function like <a href="/en/dax/function/sumx">SUMX</a>, which is exactly what we are looking for to calculate total sales:
Sales non USA =
SUMX(
FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
),
Sales[SalesAmount]
)
What we are doing is adding the <em>SalesAmount</em> field for each of the rows of the filtered table, and this is composed of the set of sales records that do not have the United States associated as a country, but without excluding other possible filters that come given by the context.
In this way, if we take this measure to a card:
...we see that the total is correct. And if we take it to a table together with the <em>Country</em> field of <em>Geography</em>:
...we see that the measure is correctly adapted to the context, just as we wanted.
', 'en') (Line: 118)
Drupal\filter\Element\ProcessedText::preRenderText(Array)
call_user_func_array(Array, Array) (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 788)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 374)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 125)
__TwigTemplate_a7d6005c89ae729617b9a0c2bccb1776->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 46)
__TwigTemplate_804f7948456cfe20e11a34c43439c7c2->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 43)
__TwigTemplate_c80c0b77898c75587c022d0756404fc4->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/contrib/classy/templates/field/field--text-long.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('field', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 446)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 74)
__TwigTemplate_94047fbdba6937b76a4479dfa1763452->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/custom/yg_aesthetic/templates/node.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('node', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 242)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 235)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 132)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 174)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191)
Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 713)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
- Deprecated function: Creation of dynamic property Drupal\mysql\Driver\Database\mysql\Select::$alterTags is deprecated in Drupal\Core\Database\Query\Select->addTag() (line 149 of core/lib/Drupal/Core/Database/Query/Select.php).
Drupal\Core\Database\Query\Select->addTag('file_load_multiple') (Line: 696)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->buildQuery(Array) (Line: 422)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->getFromStorage(Array) (Line: 393)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->doLoadMultiple(Array) (Line: 346)
Drupal\Core\Entity\EntityStorageBase->loadMultiple(Array) (Line: 641)
Drupal\Core\Entity\EntityStorageBase->loadByProperties(Array) (Line: 63)
Drupal\Core\Entity\EntityRepository->loadEntityByUuid('file', 'e2427ade-b4f5-48a7-8e40-c15a17b8bb68') (Line: 95)
Drupal\editor\Plugin\Filter\EditorFileReference->process('Now suppose that in the <em>Country</em> field of the <em>Geography</em> table we have the country in which the reseller who made each sale is located. Let's look at sales by country first. For this we simply take the measure that adds the sales (<em>Sales</em>) and the <em>Country</em> field to a table type display:
The <em>Sales</em> measure is summing the field that contains the sales figure, <em>SalesAmount</em>:
Sales = SUM(Sales[SalesAmount])
Now suppose that we want to be able to analyze sales in all countries other than the United States. A first option would be to use the <a href="/en/dax/function/calculate">CALCULATE</a> function to revalue the <em>Sales</em> measure:
Non USA sales = CALCULATE([Sales], Geography[Country] <> "United States")
We can take this new measure to a card type display to see the result:
The figure is correct, but if we take this measure to a table together with the <em>Country</em> field to show sales outside the United States segmented by country, the result is the following:
Of course, this is not what we wanted, but the CALCULATE function is modifying the context to always consider all countries other than the United States.
What we want is to be able to use the <em>SalesAmount</em> field that contains the sales figure but including only those sales records that do not correspond to resellers located in the United States. To begin with, we can build this table that only considers the countries of interest using the <a href="/en/dax/function/filter">FILTER</a> function. The pseudocode would be something like:
Filtered table = FILTER(
Sales,
Countries other than the United States
)
If the <em>Sales</em> table included a "<em>Country</em>" field, it would be enough to add <em>Country <> "United States"</em> instead of "<em>Countries other than the United States</em>", but it does not include it. This information relative to the country in which the reseller is located is in another table, the aforementioned <em>Geography</em> table, a table that is not directly accessible as an argument of the FILTER function. It is in this situation that the RELATED function comes in handy. Assuming that there is a relationship (of many-to-one or one-to-one type) between the sales table and the geography table, we can access from the first to the <em>Country</em> column of the second with the expression:
RELATED(Geography[Country])
Now the code for the filtered table would be as follows:
Filtered table = FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
)
As mentioned, the RELATED function requires a row context, which we can achieve using a table scan function like <a href="/en/dax/function/sumx">SUMX</a>, which is exactly what we are looking for to calculate total sales:
Sales non USA =
SUMX(
FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
),
Sales[SalesAmount]
)
What we are doing is adding the <em>SalesAmount</em> field for each of the rows of the filtered table, and this is composed of the set of sales records that do not have the United States associated as a country, but without excluding other possible filters that come given by the context.
In this way, if we take this measure to a card:
...we see that the total is correct. And if we take it to a table together with the <em>Country</em> field of <em>Geography</em>:
...we see that the measure is correctly adapted to the context, just as we wanted.
', 'en') (Line: 118)
Drupal\filter\Element\ProcessedText::preRenderText(Array)
call_user_func_array(Array, Array) (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 788)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 374)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 125)
__TwigTemplate_a7d6005c89ae729617b9a0c2bccb1776->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 46)
__TwigTemplate_804f7948456cfe20e11a34c43439c7c2->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 43)
__TwigTemplate_c80c0b77898c75587c022d0756404fc4->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/contrib/classy/templates/field/field--text-long.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('field', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 446)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 74)
__TwigTemplate_94047fbdba6937b76a4479dfa1763452->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/custom/yg_aesthetic/templates/node.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('node', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 242)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 235)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 132)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 174)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191)
Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 713)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
- Deprecated function: Creation of dynamic property Drupal\mysql\Driver\Database\mysql\Select::$alterMetaData is deprecated in Drupal\Core\Database\Query\Select->addMetaData() (line 178 of core/lib/Drupal/Core/Database/Query/Select.php).
Drupal\Core\Database\Query\Select->addMetaData('entity_type', 'file') (Line: 115)
Drupal\Core\Entity\Query\Sql\Query->prepare() (Line: 80)
Drupal\Core\Entity\Query\Sql\Query->execute() (Line: 640)
Drupal\Core\Entity\EntityStorageBase->loadByProperties(Array) (Line: 63)
Drupal\Core\Entity\EntityRepository->loadEntityByUuid('file', 'e2427ade-b4f5-48a7-8e40-c15a17b8bb68') (Line: 124)
Drupal\editor\Plugin\Filter\EditorFileReference->process('Now suppose that in the <em>Country</em> field of the <em>Geography</em> table we have the country in which the reseller who made each sale is located. Let's look at sales by country first. For this we simply take the measure that adds the sales (<em>Sales</em>) and the <em>Country</em> field to a table type display:
The <em>Sales</em> measure is summing the field that contains the sales figure, <em>SalesAmount</em>:
Sales = SUM(Sales[SalesAmount])
Now suppose that we want to be able to analyze sales in all countries other than the United States. A first option would be to use the <a href="/en/dax/function/calculate">CALCULATE</a> function to revalue the <em>Sales</em> measure:
Non USA sales = CALCULATE([Sales], Geography[Country] <> "United States")
We can take this new measure to a card type display to see the result:
The figure is correct, but if we take this measure to a table together with the <em>Country</em> field to show sales outside the United States segmented by country, the result is the following:
Of course, this is not what we wanted, but the CALCULATE function is modifying the context to always consider all countries other than the United States.
What we want is to be able to use the <em>SalesAmount</em> field that contains the sales figure but including only those sales records that do not correspond to resellers located in the United States. To begin with, we can build this table that only considers the countries of interest using the <a href="/en/dax/function/filter">FILTER</a> function. The pseudocode would be something like:
Filtered table = FILTER(
Sales,
Countries other than the United States
)
If the <em>Sales</em> table included a "<em>Country</em>" field, it would be enough to add <em>Country <> "United States"</em> instead of "<em>Countries other than the United States</em>", but it does not include it. This information relative to the country in which the reseller is located is in another table, the aforementioned <em>Geography</em> table, a table that is not directly accessible as an argument of the FILTER function. It is in this situation that the RELATED function comes in handy. Assuming that there is a relationship (of many-to-one or one-to-one type) between the sales table and the geography table, we can access from the first to the <em>Country</em> column of the second with the expression:
RELATED(Geography[Country])
Now the code for the filtered table would be as follows:
Filtered table = FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
)
As mentioned, the RELATED function requires a row context, which we can achieve using a table scan function like <a href="/en/dax/function/sumx">SUMX</a>, which is exactly what we are looking for to calculate total sales:
Sales non USA =
SUMX(
FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
),
Sales[SalesAmount]
)
What we are doing is adding the <em>SalesAmount</em> field for each of the rows of the filtered table, and this is composed of the set of sales records that do not have the United States associated as a country, but without excluding other possible filters that come given by the context.
In this way, if we take this measure to a card:
...we see that the total is correct. And if we take it to a table together with the <em>Country</em> field of <em>Geography</em>:
...we see that the measure is correctly adapted to the context, just as we wanted.
', 'en') (Line: 118)
Drupal\filter\Element\ProcessedText::preRenderText(Array)
call_user_func_array(Array, Array) (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 788)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 374)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 125)
__TwigTemplate_a7d6005c89ae729617b9a0c2bccb1776->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 46)
__TwigTemplate_804f7948456cfe20e11a34c43439c7c2->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 43)
__TwigTemplate_c80c0b77898c75587c022d0756404fc4->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/contrib/classy/templates/field/field--text-long.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('field', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 446)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 74)
__TwigTemplate_94047fbdba6937b76a4479dfa1763452->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/custom/yg_aesthetic/templates/node.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('node', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 242)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 235)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 132)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 174)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191)
Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 713)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
- Deprecated function: Creation of dynamic property Drupal\mysql\Driver\Database\mysql\Select::$alterTags is deprecated in Drupal\Core\Database\Query\Select->addTag() (line 149 of core/lib/Drupal/Core/Database/Query/Select.php).
Drupal\Core\Database\Query\Select->addTag('entity_query') (Line: 147)
Drupal\Core\Entity\Query\Sql\Query->prepare() (Line: 80)
Drupal\Core\Entity\Query\Sql\Query->execute() (Line: 640)
Drupal\Core\Entity\EntityStorageBase->loadByProperties(Array) (Line: 63)
Drupal\Core\Entity\EntityRepository->loadEntityByUuid('file', 'e2427ade-b4f5-48a7-8e40-c15a17b8bb68') (Line: 124)
Drupal\editor\Plugin\Filter\EditorFileReference->process('Now suppose that in the <em>Country</em> field of the <em>Geography</em> table we have the country in which the reseller who made each sale is located. Let's look at sales by country first. For this we simply take the measure that adds the sales (<em>Sales</em>) and the <em>Country</em> field to a table type display:
The <em>Sales</em> measure is summing the field that contains the sales figure, <em>SalesAmount</em>:
Sales = SUM(Sales[SalesAmount])
Now suppose that we want to be able to analyze sales in all countries other than the United States. A first option would be to use the <a href="/en/dax/function/calculate">CALCULATE</a> function to revalue the <em>Sales</em> measure:
Non USA sales = CALCULATE([Sales], Geography[Country] <> "United States")
We can take this new measure to a card type display to see the result:
The figure is correct, but if we take this measure to a table together with the <em>Country</em> field to show sales outside the United States segmented by country, the result is the following:
Of course, this is not what we wanted, but the CALCULATE function is modifying the context to always consider all countries other than the United States.
What we want is to be able to use the <em>SalesAmount</em> field that contains the sales figure but including only those sales records that do not correspond to resellers located in the United States. To begin with, we can build this table that only considers the countries of interest using the <a href="/en/dax/function/filter">FILTER</a> function. The pseudocode would be something like:
Filtered table = FILTER(
Sales,
Countries other than the United States
)
If the <em>Sales</em> table included a "<em>Country</em>" field, it would be enough to add <em>Country <> "United States"</em> instead of "<em>Countries other than the United States</em>", but it does not include it. This information relative to the country in which the reseller is located is in another table, the aforementioned <em>Geography</em> table, a table that is not directly accessible as an argument of the FILTER function. It is in this situation that the RELATED function comes in handy. Assuming that there is a relationship (of many-to-one or one-to-one type) between the sales table and the geography table, we can access from the first to the <em>Country</em> column of the second with the expression:
RELATED(Geography[Country])
Now the code for the filtered table would be as follows:
Filtered table = FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
)
As mentioned, the RELATED function requires a row context, which we can achieve using a table scan function like <a href="/en/dax/function/sumx">SUMX</a>, which is exactly what we are looking for to calculate total sales:
Sales non USA =
SUMX(
FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
),
Sales[SalesAmount]
)
What we are doing is adding the <em>SalesAmount</em> field for each of the rows of the filtered table, and this is composed of the set of sales records that do not have the United States associated as a country, but without excluding other possible filters that come given by the context.
In this way, if we take this measure to a card:
...we see that the total is correct. And if we take it to a table together with the <em>Country</em> field of <em>Geography</em>:
...we see that the measure is correctly adapted to the context, just as we wanted.
', 'en') (Line: 118)
Drupal\filter\Element\ProcessedText::preRenderText(Array)
call_user_func_array(Array, Array) (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 788)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 374)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 125)
__TwigTemplate_a7d6005c89ae729617b9a0c2bccb1776->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 46)
__TwigTemplate_804f7948456cfe20e11a34c43439c7c2->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 43)
__TwigTemplate_c80c0b77898c75587c022d0756404fc4->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/contrib/classy/templates/field/field--text-long.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('field', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 446)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 74)
__TwigTemplate_94047fbdba6937b76a4479dfa1763452->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/custom/yg_aesthetic/templates/node.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('node', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 242)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 235)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 132)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 174)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191)
Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 713)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
- Deprecated function: Creation of dynamic property Drupal\mysql\Driver\Database\mysql\Select::$alterMetaData is deprecated in Drupal\Core\Database\Query\Select->addMetaData() (line 178 of core/lib/Drupal/Core/Database/Query/Select.php).
Drupal\Core\Database\Query\Select->addMetaData('entity_type', 'file') (Line: 115)
Drupal\Core\Entity\Query\Sql\Query->prepare() (Line: 80)
Drupal\Core\Entity\Query\Sql\Query->execute() (Line: 640)
Drupal\Core\Entity\EntityStorageBase->loadByProperties(Array) (Line: 63)
Drupal\Core\Entity\EntityRepository->loadEntityByUuid('file', '888cf6f1-afd6-4a31-9de4-b8f255202c01') (Line: 95)
Drupal\editor\Plugin\Filter\EditorFileReference->process('Now suppose that in the <em>Country</em> field of the <em>Geography</em> table we have the country in which the reseller who made each sale is located. Let's look at sales by country first. For this we simply take the measure that adds the sales (<em>Sales</em>) and the <em>Country</em> field to a table type display:
The <em>Sales</em> measure is summing the field that contains the sales figure, <em>SalesAmount</em>:
Sales = SUM(Sales[SalesAmount])
Now suppose that we want to be able to analyze sales in all countries other than the United States. A first option would be to use the <a href="/en/dax/function/calculate">CALCULATE</a> function to revalue the <em>Sales</em> measure:
Non USA sales = CALCULATE([Sales], Geography[Country] <> "United States")
We can take this new measure to a card type display to see the result:
The figure is correct, but if we take this measure to a table together with the <em>Country</em> field to show sales outside the United States segmented by country, the result is the following:
Of course, this is not what we wanted, but the CALCULATE function is modifying the context to always consider all countries other than the United States.
What we want is to be able to use the <em>SalesAmount</em> field that contains the sales figure but including only those sales records that do not correspond to resellers located in the United States. To begin with, we can build this table that only considers the countries of interest using the <a href="/en/dax/function/filter">FILTER</a> function. The pseudocode would be something like:
Filtered table = FILTER(
Sales,
Countries other than the United States
)
If the <em>Sales</em> table included a "<em>Country</em>" field, it would be enough to add <em>Country <> "United States"</em> instead of "<em>Countries other than the United States</em>", but it does not include it. This information relative to the country in which the reseller is located is in another table, the aforementioned <em>Geography</em> table, a table that is not directly accessible as an argument of the FILTER function. It is in this situation that the RELATED function comes in handy. Assuming that there is a relationship (of many-to-one or one-to-one type) between the sales table and the geography table, we can access from the first to the <em>Country</em> column of the second with the expression:
RELATED(Geography[Country])
Now the code for the filtered table would be as follows:
Filtered table = FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
)
As mentioned, the RELATED function requires a row context, which we can achieve using a table scan function like <a href="/en/dax/function/sumx">SUMX</a>, which is exactly what we are looking for to calculate total sales:
Sales non USA =
SUMX(
FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
),
Sales[SalesAmount]
)
What we are doing is adding the <em>SalesAmount</em> field for each of the rows of the filtered table, and this is composed of the set of sales records that do not have the United States associated as a country, but without excluding other possible filters that come given by the context.
In this way, if we take this measure to a card:
...we see that the total is correct. And if we take it to a table together with the <em>Country</em> field of <em>Geography</em>:
...we see that the measure is correctly adapted to the context, just as we wanted.
', 'en') (Line: 118)
Drupal\filter\Element\ProcessedText::preRenderText(Array)
call_user_func_array(Array, Array) (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 788)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 374)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 125)
__TwigTemplate_a7d6005c89ae729617b9a0c2bccb1776->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 46)
__TwigTemplate_804f7948456cfe20e11a34c43439c7c2->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 43)
__TwigTemplate_c80c0b77898c75587c022d0756404fc4->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/contrib/classy/templates/field/field--text-long.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('field', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 446)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 74)
__TwigTemplate_94047fbdba6937b76a4479dfa1763452->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/custom/yg_aesthetic/templates/node.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('node', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 242)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 235)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 132)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 174)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191)
Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 713)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
- Deprecated function: Creation of dynamic property Drupal\mysql\Driver\Database\mysql\Select::$alterTags is deprecated in Drupal\Core\Database\Query\Select->addTag() (line 149 of core/lib/Drupal/Core/Database/Query/Select.php).
Drupal\Core\Database\Query\Select->addTag('entity_query') (Line: 147)
Drupal\Core\Entity\Query\Sql\Query->prepare() (Line: 80)
Drupal\Core\Entity\Query\Sql\Query->execute() (Line: 640)
Drupal\Core\Entity\EntityStorageBase->loadByProperties(Array) (Line: 63)
Drupal\Core\Entity\EntityRepository->loadEntityByUuid('file', '888cf6f1-afd6-4a31-9de4-b8f255202c01') (Line: 95)
Drupal\editor\Plugin\Filter\EditorFileReference->process('Now suppose that in the <em>Country</em> field of the <em>Geography</em> table we have the country in which the reseller who made each sale is located. Let's look at sales by country first. For this we simply take the measure that adds the sales (<em>Sales</em>) and the <em>Country</em> field to a table type display:
The <em>Sales</em> measure is summing the field that contains the sales figure, <em>SalesAmount</em>:
Sales = SUM(Sales[SalesAmount])
Now suppose that we want to be able to analyze sales in all countries other than the United States. A first option would be to use the <a href="/en/dax/function/calculate">CALCULATE</a> function to revalue the <em>Sales</em> measure:
Non USA sales = CALCULATE([Sales], Geography[Country] <> "United States")
We can take this new measure to a card type display to see the result:
The figure is correct, but if we take this measure to a table together with the <em>Country</em> field to show sales outside the United States segmented by country, the result is the following:
Of course, this is not what we wanted, but the CALCULATE function is modifying the context to always consider all countries other than the United States.
What we want is to be able to use the <em>SalesAmount</em> field that contains the sales figure but including only those sales records that do not correspond to resellers located in the United States. To begin with, we can build this table that only considers the countries of interest using the <a href="/en/dax/function/filter">FILTER</a> function. The pseudocode would be something like:
Filtered table = FILTER(
Sales,
Countries other than the United States
)
If the <em>Sales</em> table included a "<em>Country</em>" field, it would be enough to add <em>Country <> "United States"</em> instead of "<em>Countries other than the United States</em>", but it does not include it. This information relative to the country in which the reseller is located is in another table, the aforementioned <em>Geography</em> table, a table that is not directly accessible as an argument of the FILTER function. It is in this situation that the RELATED function comes in handy. Assuming that there is a relationship (of many-to-one or one-to-one type) between the sales table and the geography table, we can access from the first to the <em>Country</em> column of the second with the expression:
RELATED(Geography[Country])
Now the code for the filtered table would be as follows:
Filtered table = FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
)
As mentioned, the RELATED function requires a row context, which we can achieve using a table scan function like <a href="/en/dax/function/sumx">SUMX</a>, which is exactly what we are looking for to calculate total sales:
Sales non USA =
SUMX(
FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
),
Sales[SalesAmount]
)
What we are doing is adding the <em>SalesAmount</em> field for each of the rows of the filtered table, and this is composed of the set of sales records that do not have the United States associated as a country, but without excluding other possible filters that come given by the context.
In this way, if we take this measure to a card:
...we see that the total is correct. And if we take it to a table together with the <em>Country</em> field of <em>Geography</em>:
...we see that the measure is correctly adapted to the context, just as we wanted.
', 'en') (Line: 118)
Drupal\filter\Element\ProcessedText::preRenderText(Array)
call_user_func_array(Array, Array) (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 788)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 374)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 125)
__TwigTemplate_a7d6005c89ae729617b9a0c2bccb1776->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 46)
__TwigTemplate_804f7948456cfe20e11a34c43439c7c2->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 43)
__TwigTemplate_c80c0b77898c75587c022d0756404fc4->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/contrib/classy/templates/field/field--text-long.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('field', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 446)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 74)
__TwigTemplate_94047fbdba6937b76a4479dfa1763452->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/custom/yg_aesthetic/templates/node.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('node', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 242)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 235)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 132)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 174)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191)
Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 713)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
- Deprecated function: Creation of dynamic property Drupal\mysql\Driver\Database\mysql\Select::$alterTags is deprecated in Drupal\Core\Database\Query\Select->addTag() (line 149 of core/lib/Drupal/Core/Database/Query/Select.php).
Drupal\Core\Database\Query\Select->addTag('file_load_multiple') (Line: 696)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->buildQuery(Array) (Line: 422)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->getFromStorage(Array) (Line: 393)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->doLoadMultiple(Array) (Line: 346)
Drupal\Core\Entity\EntityStorageBase->loadMultiple(Array) (Line: 641)
Drupal\Core\Entity\EntityStorageBase->loadByProperties(Array) (Line: 63)
Drupal\Core\Entity\EntityRepository->loadEntityByUuid('file', '888cf6f1-afd6-4a31-9de4-b8f255202c01') (Line: 95)
Drupal\editor\Plugin\Filter\EditorFileReference->process('Now suppose that in the <em>Country</em> field of the <em>Geography</em> table we have the country in which the reseller who made each sale is located. Let's look at sales by country first. For this we simply take the measure that adds the sales (<em>Sales</em>) and the <em>Country</em> field to a table type display:
The <em>Sales</em> measure is summing the field that contains the sales figure, <em>SalesAmount</em>:
Sales = SUM(Sales[SalesAmount])
Now suppose that we want to be able to analyze sales in all countries other than the United States. A first option would be to use the <a href="/en/dax/function/calculate">CALCULATE</a> function to revalue the <em>Sales</em> measure:
Non USA sales = CALCULATE([Sales], Geography[Country] <> "United States")
We can take this new measure to a card type display to see the result:
The figure is correct, but if we take this measure to a table together with the <em>Country</em> field to show sales outside the United States segmented by country, the result is the following:
Of course, this is not what we wanted, but the CALCULATE function is modifying the context to always consider all countries other than the United States.
What we want is to be able to use the <em>SalesAmount</em> field that contains the sales figure but including only those sales records that do not correspond to resellers located in the United States. To begin with, we can build this table that only considers the countries of interest using the <a href="/en/dax/function/filter">FILTER</a> function. The pseudocode would be something like:
Filtered table = FILTER(
Sales,
Countries other than the United States
)
If the <em>Sales</em> table included a "<em>Country</em>" field, it would be enough to add <em>Country <> "United States"</em> instead of "<em>Countries other than the United States</em>", but it does not include it. This information relative to the country in which the reseller is located is in another table, the aforementioned <em>Geography</em> table, a table that is not directly accessible as an argument of the FILTER function. It is in this situation that the RELATED function comes in handy. Assuming that there is a relationship (of many-to-one or one-to-one type) between the sales table and the geography table, we can access from the first to the <em>Country</em> column of the second with the expression:
RELATED(Geography[Country])
Now the code for the filtered table would be as follows:
Filtered table = FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
)
As mentioned, the RELATED function requires a row context, which we can achieve using a table scan function like <a href="/en/dax/function/sumx">SUMX</a>, which is exactly what we are looking for to calculate total sales:
Sales non USA =
SUMX(
FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
),
Sales[SalesAmount]
)
What we are doing is adding the <em>SalesAmount</em> field for each of the rows of the filtered table, and this is composed of the set of sales records that do not have the United States associated as a country, but without excluding other possible filters that come given by the context.
In this way, if we take this measure to a card:
...we see that the total is correct. And if we take it to a table together with the <em>Country</em> field of <em>Geography</em>:
...we see that the measure is correctly adapted to the context, just as we wanted.
', 'en') (Line: 118)
Drupal\filter\Element\ProcessedText::preRenderText(Array)
call_user_func_array(Array, Array) (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 788)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 374)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 125)
__TwigTemplate_a7d6005c89ae729617b9a0c2bccb1776->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 46)
__TwigTemplate_804f7948456cfe20e11a34c43439c7c2->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 43)
__TwigTemplate_c80c0b77898c75587c022d0756404fc4->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/contrib/classy/templates/field/field--text-long.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('field', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 446)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 74)
__TwigTemplate_94047fbdba6937b76a4479dfa1763452->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/custom/yg_aesthetic/templates/node.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('node', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 242)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 235)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 132)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 174)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191)
Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 713)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
- Deprecated function: Creation of dynamic property Drupal\mysql\Driver\Database\mysql\Select::$alterMetaData is deprecated in Drupal\Core\Database\Query\Select->addMetaData() (line 178 of core/lib/Drupal/Core/Database/Query/Select.php).
Drupal\Core\Database\Query\Select->addMetaData('entity_type', 'file') (Line: 115)
Drupal\Core\Entity\Query\Sql\Query->prepare() (Line: 80)
Drupal\Core\Entity\Query\Sql\Query->execute() (Line: 640)
Drupal\Core\Entity\EntityStorageBase->loadByProperties(Array) (Line: 63)
Drupal\Core\Entity\EntityRepository->loadEntityByUuid('file', '888cf6f1-afd6-4a31-9de4-b8f255202c01') (Line: 124)
Drupal\editor\Plugin\Filter\EditorFileReference->process('Now suppose that in the <em>Country</em> field of the <em>Geography</em> table we have the country in which the reseller who made each sale is located. Let's look at sales by country first. For this we simply take the measure that adds the sales (<em>Sales</em>) and the <em>Country</em> field to a table type display:
The <em>Sales</em> measure is summing the field that contains the sales figure, <em>SalesAmount</em>:
Sales = SUM(Sales[SalesAmount])
Now suppose that we want to be able to analyze sales in all countries other than the United States. A first option would be to use the <a href="/en/dax/function/calculate">CALCULATE</a> function to revalue the <em>Sales</em> measure:
Non USA sales = CALCULATE([Sales], Geography[Country] <> "United States")
We can take this new measure to a card type display to see the result:
The figure is correct, but if we take this measure to a table together with the <em>Country</em> field to show sales outside the United States segmented by country, the result is the following:
Of course, this is not what we wanted, but the CALCULATE function is modifying the context to always consider all countries other than the United States.
What we want is to be able to use the <em>SalesAmount</em> field that contains the sales figure but including only those sales records that do not correspond to resellers located in the United States. To begin with, we can build this table that only considers the countries of interest using the <a href="/en/dax/function/filter">FILTER</a> function. The pseudocode would be something like:
Filtered table = FILTER(
Sales,
Countries other than the United States
)
If the <em>Sales</em> table included a "<em>Country</em>" field, it would be enough to add <em>Country <> "United States"</em> instead of "<em>Countries other than the United States</em>", but it does not include it. This information relative to the country in which the reseller is located is in another table, the aforementioned <em>Geography</em> table, a table that is not directly accessible as an argument of the FILTER function. It is in this situation that the RELATED function comes in handy. Assuming that there is a relationship (of many-to-one or one-to-one type) between the sales table and the geography table, we can access from the first to the <em>Country</em> column of the second with the expression:
RELATED(Geography[Country])
Now the code for the filtered table would be as follows:
Filtered table = FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
)
As mentioned, the RELATED function requires a row context, which we can achieve using a table scan function like <a href="/en/dax/function/sumx">SUMX</a>, which is exactly what we are looking for to calculate total sales:
Sales non USA =
SUMX(
FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
),
Sales[SalesAmount]
)
What we are doing is adding the <em>SalesAmount</em> field for each of the rows of the filtered table, and this is composed of the set of sales records that do not have the United States associated as a country, but without excluding other possible filters that come given by the context.
In this way, if we take this measure to a card:
...we see that the total is correct. And if we take it to a table together with the <em>Country</em> field of <em>Geography</em>:
...we see that the measure is correctly adapted to the context, just as we wanted.
', 'en') (Line: 118)
Drupal\filter\Element\ProcessedText::preRenderText(Array)
call_user_func_array(Array, Array) (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 788)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 374)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 125)
__TwigTemplate_a7d6005c89ae729617b9a0c2bccb1776->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 46)
__TwigTemplate_804f7948456cfe20e11a34c43439c7c2->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 43)
__TwigTemplate_c80c0b77898c75587c022d0756404fc4->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/contrib/classy/templates/field/field--text-long.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('field', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 446)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 74)
__TwigTemplate_94047fbdba6937b76a4479dfa1763452->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/custom/yg_aesthetic/templates/node.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('node', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 242)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 235)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 132)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 174)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191)
Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 713)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
- Deprecated function: Creation of dynamic property Drupal\mysql\Driver\Database\mysql\Select::$alterTags is deprecated in Drupal\Core\Database\Query\Select->addTag() (line 149 of core/lib/Drupal/Core/Database/Query/Select.php).
Drupal\Core\Database\Query\Select->addTag('entity_query') (Line: 147)
Drupal\Core\Entity\Query\Sql\Query->prepare() (Line: 80)
Drupal\Core\Entity\Query\Sql\Query->execute() (Line: 640)
Drupal\Core\Entity\EntityStorageBase->loadByProperties(Array) (Line: 63)
Drupal\Core\Entity\EntityRepository->loadEntityByUuid('file', '888cf6f1-afd6-4a31-9de4-b8f255202c01') (Line: 124)
Drupal\editor\Plugin\Filter\EditorFileReference->process('Now suppose that in the <em>Country</em> field of the <em>Geography</em> table we have the country in which the reseller who made each sale is located. Let's look at sales by country first. For this we simply take the measure that adds the sales (<em>Sales</em>) and the <em>Country</em> field to a table type display:
The <em>Sales</em> measure is summing the field that contains the sales figure, <em>SalesAmount</em>:
Sales = SUM(Sales[SalesAmount])
Now suppose that we want to be able to analyze sales in all countries other than the United States. A first option would be to use the <a href="/en/dax/function/calculate">CALCULATE</a> function to revalue the <em>Sales</em> measure:
Non USA sales = CALCULATE([Sales], Geography[Country] <> "United States")
We can take this new measure to a card type display to see the result:
The figure is correct, but if we take this measure to a table together with the <em>Country</em> field to show sales outside the United States segmented by country, the result is the following:
Of course, this is not what we wanted, but the CALCULATE function is modifying the context to always consider all countries other than the United States.
What we want is to be able to use the <em>SalesAmount</em> field that contains the sales figure but including only those sales records that do not correspond to resellers located in the United States. To begin with, we can build this table that only considers the countries of interest using the <a href="/en/dax/function/filter">FILTER</a> function. The pseudocode would be something like:
Filtered table = FILTER(
Sales,
Countries other than the United States
)
If the <em>Sales</em> table included a "<em>Country</em>" field, it would be enough to add <em>Country <> "United States"</em> instead of "<em>Countries other than the United States</em>", but it does not include it. This information relative to the country in which the reseller is located is in another table, the aforementioned <em>Geography</em> table, a table that is not directly accessible as an argument of the FILTER function. It is in this situation that the RELATED function comes in handy. Assuming that there is a relationship (of many-to-one or one-to-one type) between the sales table and the geography table, we can access from the first to the <em>Country</em> column of the second with the expression:
RELATED(Geography[Country])
Now the code for the filtered table would be as follows:
Filtered table = FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
)
As mentioned, the RELATED function requires a row context, which we can achieve using a table scan function like <a href="/en/dax/function/sumx">SUMX</a>, which is exactly what we are looking for to calculate total sales:
Sales non USA =
SUMX(
FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
),
Sales[SalesAmount]
)
What we are doing is adding the <em>SalesAmount</em> field for each of the rows of the filtered table, and this is composed of the set of sales records that do not have the United States associated as a country, but without excluding other possible filters that come given by the context.
In this way, if we take this measure to a card:
...we see that the total is correct. And if we take it to a table together with the <em>Country</em> field of <em>Geography</em>:
...we see that the measure is correctly adapted to the context, just as we wanted.
', 'en') (Line: 118)
Drupal\filter\Element\ProcessedText::preRenderText(Array)
call_user_func_array(Array, Array) (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 788)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 374)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 125)
__TwigTemplate_a7d6005c89ae729617b9a0c2bccb1776->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 46)
__TwigTemplate_804f7948456cfe20e11a34c43439c7c2->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 43)
__TwigTemplate_c80c0b77898c75587c022d0756404fc4->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/contrib/classy/templates/field/field--text-long.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('field', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 446)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 74)
__TwigTemplate_94047fbdba6937b76a4479dfa1763452->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/custom/yg_aesthetic/templates/node.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('node', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 242)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 235)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 132)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 174)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191)
Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 713)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
- Deprecated function: Creation of dynamic property Drupal\mysql\Driver\Database\mysql\Select::$alterMetaData is deprecated in Drupal\Core\Database\Query\Select->addMetaData() (line 178 of core/lib/Drupal/Core/Database/Query/Select.php).
Drupal\Core\Database\Query\Select->addMetaData('entity_type', 'file') (Line: 115)
Drupal\Core\Entity\Query\Sql\Query->prepare() (Line: 80)
Drupal\Core\Entity\Query\Sql\Query->execute() (Line: 640)
Drupal\Core\Entity\EntityStorageBase->loadByProperties(Array) (Line: 63)
Drupal\Core\Entity\EntityRepository->loadEntityByUuid('file', '830c4044-336e-49e0-a45f-0c032db335c9') (Line: 95)
Drupal\editor\Plugin\Filter\EditorFileReference->process('Now suppose that in the <em>Country</em> field of the <em>Geography</em> table we have the country in which the reseller who made each sale is located. Let's look at sales by country first. For this we simply take the measure that adds the sales (<em>Sales</em>) and the <em>Country</em> field to a table type display:
The <em>Sales</em> measure is summing the field that contains the sales figure, <em>SalesAmount</em>:
Sales = SUM(Sales[SalesAmount])
Now suppose that we want to be able to analyze sales in all countries other than the United States. A first option would be to use the <a href="/en/dax/function/calculate">CALCULATE</a> function to revalue the <em>Sales</em> measure:
Non USA sales = CALCULATE([Sales], Geography[Country] <> "United States")
We can take this new measure to a card type display to see the result:
The figure is correct, but if we take this measure to a table together with the <em>Country</em> field to show sales outside the United States segmented by country, the result is the following:
Of course, this is not what we wanted, but the CALCULATE function is modifying the context to always consider all countries other than the United States.
What we want is to be able to use the <em>SalesAmount</em> field that contains the sales figure but including only those sales records that do not correspond to resellers located in the United States. To begin with, we can build this table that only considers the countries of interest using the <a href="/en/dax/function/filter">FILTER</a> function. The pseudocode would be something like:
Filtered table = FILTER(
Sales,
Countries other than the United States
)
If the <em>Sales</em> table included a "<em>Country</em>" field, it would be enough to add <em>Country <> "United States"</em> instead of "<em>Countries other than the United States</em>", but it does not include it. This information relative to the country in which the reseller is located is in another table, the aforementioned <em>Geography</em> table, a table that is not directly accessible as an argument of the FILTER function. It is in this situation that the RELATED function comes in handy. Assuming that there is a relationship (of many-to-one or one-to-one type) between the sales table and the geography table, we can access from the first to the <em>Country</em> column of the second with the expression:
RELATED(Geography[Country])
Now the code for the filtered table would be as follows:
Filtered table = FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
)
As mentioned, the RELATED function requires a row context, which we can achieve using a table scan function like <a href="/en/dax/function/sumx">SUMX</a>, which is exactly what we are looking for to calculate total sales:
Sales non USA =
SUMX(
FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
),
Sales[SalesAmount]
)
What we are doing is adding the <em>SalesAmount</em> field for each of the rows of the filtered table, and this is composed of the set of sales records that do not have the United States associated as a country, but without excluding other possible filters that come given by the context.
In this way, if we take this measure to a card:
...we see that the total is correct. And if we take it to a table together with the <em>Country</em> field of <em>Geography</em>:
...we see that the measure is correctly adapted to the context, just as we wanted.
', 'en') (Line: 118)
Drupal\filter\Element\ProcessedText::preRenderText(Array)
call_user_func_array(Array, Array) (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 788)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 374)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 125)
__TwigTemplate_a7d6005c89ae729617b9a0c2bccb1776->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 46)
__TwigTemplate_804f7948456cfe20e11a34c43439c7c2->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 43)
__TwigTemplate_c80c0b77898c75587c022d0756404fc4->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/contrib/classy/templates/field/field--text-long.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('field', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 446)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 74)
__TwigTemplate_94047fbdba6937b76a4479dfa1763452->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/custom/yg_aesthetic/templates/node.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('node', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 242)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 235)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 132)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 174)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191)
Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 713)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
- Deprecated function: Creation of dynamic property Drupal\mysql\Driver\Database\mysql\Select::$alterTags is deprecated in Drupal\Core\Database\Query\Select->addTag() (line 149 of core/lib/Drupal/Core/Database/Query/Select.php).
Drupal\Core\Database\Query\Select->addTag('entity_query') (Line: 147)
Drupal\Core\Entity\Query\Sql\Query->prepare() (Line: 80)
Drupal\Core\Entity\Query\Sql\Query->execute() (Line: 640)
Drupal\Core\Entity\EntityStorageBase->loadByProperties(Array) (Line: 63)
Drupal\Core\Entity\EntityRepository->loadEntityByUuid('file', '830c4044-336e-49e0-a45f-0c032db335c9') (Line: 95)
Drupal\editor\Plugin\Filter\EditorFileReference->process('Now suppose that in the <em>Country</em> field of the <em>Geography</em> table we have the country in which the reseller who made each sale is located. Let's look at sales by country first. For this we simply take the measure that adds the sales (<em>Sales</em>) and the <em>Country</em> field to a table type display:
The <em>Sales</em> measure is summing the field that contains the sales figure, <em>SalesAmount</em>:
Sales = SUM(Sales[SalesAmount])
Now suppose that we want to be able to analyze sales in all countries other than the United States. A first option would be to use the <a href="/en/dax/function/calculate">CALCULATE</a> function to revalue the <em>Sales</em> measure:
Non USA sales = CALCULATE([Sales], Geography[Country] <> "United States")
We can take this new measure to a card type display to see the result:
The figure is correct, but if we take this measure to a table together with the <em>Country</em> field to show sales outside the United States segmented by country, the result is the following:
Of course, this is not what we wanted, but the CALCULATE function is modifying the context to always consider all countries other than the United States.
What we want is to be able to use the <em>SalesAmount</em> field that contains the sales figure but including only those sales records that do not correspond to resellers located in the United States. To begin with, we can build this table that only considers the countries of interest using the <a href="/en/dax/function/filter">FILTER</a> function. The pseudocode would be something like:
Filtered table = FILTER(
Sales,
Countries other than the United States
)
If the <em>Sales</em> table included a "<em>Country</em>" field, it would be enough to add <em>Country <> "United States"</em> instead of "<em>Countries other than the United States</em>", but it does not include it. This information relative to the country in which the reseller is located is in another table, the aforementioned <em>Geography</em> table, a table that is not directly accessible as an argument of the FILTER function. It is in this situation that the RELATED function comes in handy. Assuming that there is a relationship (of many-to-one or one-to-one type) between the sales table and the geography table, we can access from the first to the <em>Country</em> column of the second with the expression:
RELATED(Geography[Country])
Now the code for the filtered table would be as follows:
Filtered table = FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
)
As mentioned, the RELATED function requires a row context, which we can achieve using a table scan function like <a href="/en/dax/function/sumx">SUMX</a>, which is exactly what we are looking for to calculate total sales:
Sales non USA =
SUMX(
FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
),
Sales[SalesAmount]
)
What we are doing is adding the <em>SalesAmount</em> field for each of the rows of the filtered table, and this is composed of the set of sales records that do not have the United States associated as a country, but without excluding other possible filters that come given by the context.
In this way, if we take this measure to a card:
...we see that the total is correct. And if we take it to a table together with the <em>Country</em> field of <em>Geography</em>:
...we see that the measure is correctly adapted to the context, just as we wanted.
', 'en') (Line: 118)
Drupal\filter\Element\ProcessedText::preRenderText(Array)
call_user_func_array(Array, Array) (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 788)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 374)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 125)
__TwigTemplate_a7d6005c89ae729617b9a0c2bccb1776->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 46)
__TwigTemplate_804f7948456cfe20e11a34c43439c7c2->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 43)
__TwigTemplate_c80c0b77898c75587c022d0756404fc4->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/contrib/classy/templates/field/field--text-long.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('field', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 446)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 74)
__TwigTemplate_94047fbdba6937b76a4479dfa1763452->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/custom/yg_aesthetic/templates/node.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('node', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 242)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 235)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 132)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 174)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191)
Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 713)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
- Deprecated function: Creation of dynamic property Drupal\mysql\Driver\Database\mysql\Select::$alterTags is deprecated in Drupal\Core\Database\Query\Select->addTag() (line 149 of core/lib/Drupal/Core/Database/Query/Select.php).
Drupal\Core\Database\Query\Select->addTag('file_load_multiple') (Line: 696)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->buildQuery(Array) (Line: 422)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->getFromStorage(Array) (Line: 393)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->doLoadMultiple(Array) (Line: 346)
Drupal\Core\Entity\EntityStorageBase->loadMultiple(Array) (Line: 641)
Drupal\Core\Entity\EntityStorageBase->loadByProperties(Array) (Line: 63)
Drupal\Core\Entity\EntityRepository->loadEntityByUuid('file', '830c4044-336e-49e0-a45f-0c032db335c9') (Line: 95)
Drupal\editor\Plugin\Filter\EditorFileReference->process('Now suppose that in the <em>Country</em> field of the <em>Geography</em> table we have the country in which the reseller who made each sale is located. Let's look at sales by country first. For this we simply take the measure that adds the sales (<em>Sales</em>) and the <em>Country</em> field to a table type display:
The <em>Sales</em> measure is summing the field that contains the sales figure, <em>SalesAmount</em>:
Sales = SUM(Sales[SalesAmount])
Now suppose that we want to be able to analyze sales in all countries other than the United States. A first option would be to use the <a href="/en/dax/function/calculate">CALCULATE</a> function to revalue the <em>Sales</em> measure:
Non USA sales = CALCULATE([Sales], Geography[Country] <> "United States")
We can take this new measure to a card type display to see the result:
The figure is correct, but if we take this measure to a table together with the <em>Country</em> field to show sales outside the United States segmented by country, the result is the following:
Of course, this is not what we wanted, but the CALCULATE function is modifying the context to always consider all countries other than the United States.
What we want is to be able to use the <em>SalesAmount</em> field that contains the sales figure but including only those sales records that do not correspond to resellers located in the United States. To begin with, we can build this table that only considers the countries of interest using the <a href="/en/dax/function/filter">FILTER</a> function. The pseudocode would be something like:
Filtered table = FILTER(
Sales,
Countries other than the United States
)
If the <em>Sales</em> table included a "<em>Country</em>" field, it would be enough to add <em>Country <> "United States"</em> instead of "<em>Countries other than the United States</em>", but it does not include it. This information relative to the country in which the reseller is located is in another table, the aforementioned <em>Geography</em> table, a table that is not directly accessible as an argument of the FILTER function. It is in this situation that the RELATED function comes in handy. Assuming that there is a relationship (of many-to-one or one-to-one type) between the sales table and the geography table, we can access from the first to the <em>Country</em> column of the second with the expression:
RELATED(Geography[Country])
Now the code for the filtered table would be as follows:
Filtered table = FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
)
As mentioned, the RELATED function requires a row context, which we can achieve using a table scan function like <a href="/en/dax/function/sumx">SUMX</a>, which is exactly what we are looking for to calculate total sales:
Sales non USA =
SUMX(
FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
),
Sales[SalesAmount]
)
What we are doing is adding the <em>SalesAmount</em> field for each of the rows of the filtered table, and this is composed of the set of sales records that do not have the United States associated as a country, but without excluding other possible filters that come given by the context.
In this way, if we take this measure to a card:
...we see that the total is correct. And if we take it to a table together with the <em>Country</em> field of <em>Geography</em>:
...we see that the measure is correctly adapted to the context, just as we wanted.
', 'en') (Line: 118)
Drupal\filter\Element\ProcessedText::preRenderText(Array)
call_user_func_array(Array, Array) (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 788)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 374)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 125)
__TwigTemplate_a7d6005c89ae729617b9a0c2bccb1776->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 46)
__TwigTemplate_804f7948456cfe20e11a34c43439c7c2->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 43)
__TwigTemplate_c80c0b77898c75587c022d0756404fc4->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/contrib/classy/templates/field/field--text-long.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('field', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 446)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 74)
__TwigTemplate_94047fbdba6937b76a4479dfa1763452->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/custom/yg_aesthetic/templates/node.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('node', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 242)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 235)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 132)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 174)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191)
Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 713)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
- Deprecated function: Creation of dynamic property Drupal\mysql\Driver\Database\mysql\Select::$alterMetaData is deprecated in Drupal\Core\Database\Query\Select->addMetaData() (line 178 of core/lib/Drupal/Core/Database/Query/Select.php).
Drupal\Core\Database\Query\Select->addMetaData('entity_type', 'file') (Line: 115)
Drupal\Core\Entity\Query\Sql\Query->prepare() (Line: 80)
Drupal\Core\Entity\Query\Sql\Query->execute() (Line: 640)
Drupal\Core\Entity\EntityStorageBase->loadByProperties(Array) (Line: 63)
Drupal\Core\Entity\EntityRepository->loadEntityByUuid('file', '830c4044-336e-49e0-a45f-0c032db335c9') (Line: 124)
Drupal\editor\Plugin\Filter\EditorFileReference->process('Now suppose that in the <em>Country</em> field of the <em>Geography</em> table we have the country in which the reseller who made each sale is located. Let's look at sales by country first. For this we simply take the measure that adds the sales (<em>Sales</em>) and the <em>Country</em> field to a table type display:
The <em>Sales</em> measure is summing the field that contains the sales figure, <em>SalesAmount</em>:
Sales = SUM(Sales[SalesAmount])
Now suppose that we want to be able to analyze sales in all countries other than the United States. A first option would be to use the <a href="/en/dax/function/calculate">CALCULATE</a> function to revalue the <em>Sales</em> measure:
Non USA sales = CALCULATE([Sales], Geography[Country] <> "United States")
We can take this new measure to a card type display to see the result:
The figure is correct, but if we take this measure to a table together with the <em>Country</em> field to show sales outside the United States segmented by country, the result is the following:
Of course, this is not what we wanted, but the CALCULATE function is modifying the context to always consider all countries other than the United States.
What we want is to be able to use the <em>SalesAmount</em> field that contains the sales figure but including only those sales records that do not correspond to resellers located in the United States. To begin with, we can build this table that only considers the countries of interest using the <a href="/en/dax/function/filter">FILTER</a> function. The pseudocode would be something like:
Filtered table = FILTER(
Sales,
Countries other than the United States
)
If the <em>Sales</em> table included a "<em>Country</em>" field, it would be enough to add <em>Country <> "United States"</em> instead of "<em>Countries other than the United States</em>", but it does not include it. This information relative to the country in which the reseller is located is in another table, the aforementioned <em>Geography</em> table, a table that is not directly accessible as an argument of the FILTER function. It is in this situation that the RELATED function comes in handy. Assuming that there is a relationship (of many-to-one or one-to-one type) between the sales table and the geography table, we can access from the first to the <em>Country</em> column of the second with the expression:
RELATED(Geography[Country])
Now the code for the filtered table would be as follows:
Filtered table = FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
)
As mentioned, the RELATED function requires a row context, which we can achieve using a table scan function like <a href="/en/dax/function/sumx">SUMX</a>, which is exactly what we are looking for to calculate total sales:
Sales non USA =
SUMX(
FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
),
Sales[SalesAmount]
)
What we are doing is adding the <em>SalesAmount</em> field for each of the rows of the filtered table, and this is composed of the set of sales records that do not have the United States associated as a country, but without excluding other possible filters that come given by the context.
In this way, if we take this measure to a card:
...we see that the total is correct. And if we take it to a table together with the <em>Country</em> field of <em>Geography</em>:
...we see that the measure is correctly adapted to the context, just as we wanted.
', 'en') (Line: 118)
Drupal\filter\Element\ProcessedText::preRenderText(Array)
call_user_func_array(Array, Array) (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 788)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 374)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 125)
__TwigTemplate_a7d6005c89ae729617b9a0c2bccb1776->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 46)
__TwigTemplate_804f7948456cfe20e11a34c43439c7c2->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 43)
__TwigTemplate_c80c0b77898c75587c022d0756404fc4->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/contrib/classy/templates/field/field--text-long.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('field', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 446)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 74)
__TwigTemplate_94047fbdba6937b76a4479dfa1763452->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/custom/yg_aesthetic/templates/node.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('node', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 242)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 235)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 132)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 174)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191)
Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 713)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
- Deprecated function: Creation of dynamic property Drupal\mysql\Driver\Database\mysql\Select::$alterTags is deprecated in Drupal\Core\Database\Query\Select->addTag() (line 149 of core/lib/Drupal/Core/Database/Query/Select.php).
Drupal\Core\Database\Query\Select->addTag('entity_query') (Line: 147)
Drupal\Core\Entity\Query\Sql\Query->prepare() (Line: 80)
Drupal\Core\Entity\Query\Sql\Query->execute() (Line: 640)
Drupal\Core\Entity\EntityStorageBase->loadByProperties(Array) (Line: 63)
Drupal\Core\Entity\EntityRepository->loadEntityByUuid('file', '830c4044-336e-49e0-a45f-0c032db335c9') (Line: 124)
Drupal\editor\Plugin\Filter\EditorFileReference->process('Now suppose that in the <em>Country</em> field of the <em>Geography</em> table we have the country in which the reseller who made each sale is located. Let's look at sales by country first. For this we simply take the measure that adds the sales (<em>Sales</em>) and the <em>Country</em> field to a table type display:
The <em>Sales</em> measure is summing the field that contains the sales figure, <em>SalesAmount</em>:
Sales = SUM(Sales[SalesAmount])
Now suppose that we want to be able to analyze sales in all countries other than the United States. A first option would be to use the <a href="/en/dax/function/calculate">CALCULATE</a> function to revalue the <em>Sales</em> measure:
Non USA sales = CALCULATE([Sales], Geography[Country] <> "United States")
We can take this new measure to a card type display to see the result:
The figure is correct, but if we take this measure to a table together with the <em>Country</em> field to show sales outside the United States segmented by country, the result is the following:
Of course, this is not what we wanted, but the CALCULATE function is modifying the context to always consider all countries other than the United States.
What we want is to be able to use the <em>SalesAmount</em> field that contains the sales figure but including only those sales records that do not correspond to resellers located in the United States. To begin with, we can build this table that only considers the countries of interest using the <a href="/en/dax/function/filter">FILTER</a> function. The pseudocode would be something like:
Filtered table = FILTER(
Sales,
Countries other than the United States
)
If the <em>Sales</em> table included a "<em>Country</em>" field, it would be enough to add <em>Country <> "United States"</em> instead of "<em>Countries other than the United States</em>", but it does not include it. This information relative to the country in which the reseller is located is in another table, the aforementioned <em>Geography</em> table, a table that is not directly accessible as an argument of the FILTER function. It is in this situation that the RELATED function comes in handy. Assuming that there is a relationship (of many-to-one or one-to-one type) between the sales table and the geography table, we can access from the first to the <em>Country</em> column of the second with the expression:
RELATED(Geography[Country])
Now the code for the filtered table would be as follows:
Filtered table = FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
)
As mentioned, the RELATED function requires a row context, which we can achieve using a table scan function like <a href="/en/dax/function/sumx">SUMX</a>, which is exactly what we are looking for to calculate total sales:
Sales non USA =
SUMX(
FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
),
Sales[SalesAmount]
)
What we are doing is adding the <em>SalesAmount</em> field for each of the rows of the filtered table, and this is composed of the set of sales records that do not have the United States associated as a country, but without excluding other possible filters that come given by the context.
In this way, if we take this measure to a card:
...we see that the total is correct. And if we take it to a table together with the <em>Country</em> field of <em>Geography</em>:
...we see that the measure is correctly adapted to the context, just as we wanted.
', 'en') (Line: 118)
Drupal\filter\Element\ProcessedText::preRenderText(Array)
call_user_func_array(Array, Array) (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 788)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 374)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 125)
__TwigTemplate_a7d6005c89ae729617b9a0c2bccb1776->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 46)
__TwigTemplate_804f7948456cfe20e11a34c43439c7c2->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 43)
__TwigTemplate_c80c0b77898c75587c022d0756404fc4->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/contrib/classy/templates/field/field--text-long.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('field', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 446)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 74)
__TwigTemplate_94047fbdba6937b76a4479dfa1763452->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/custom/yg_aesthetic/templates/node.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('node', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 242)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 235)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 132)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 174)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191)
Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 713)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
- Deprecated function: Creation of dynamic property Drupal\mysql\Driver\Database\mysql\Select::$alterMetaData is deprecated in Drupal\Core\Database\Query\Select->addMetaData() (line 178 of core/lib/Drupal/Core/Database/Query/Select.php).
Drupal\Core\Database\Query\Select->addMetaData('entity_type', 'file') (Line: 115)
Drupal\Core\Entity\Query\Sql\Query->prepare() (Line: 80)
Drupal\Core\Entity\Query\Sql\Query->execute() (Line: 640)
Drupal\Core\Entity\EntityStorageBase->loadByProperties(Array) (Line: 63)
Drupal\Core\Entity\EntityRepository->loadEntityByUuid('file', 'ca71f32d-85e4-4779-8378-41e8dd2026f1') (Line: 95)
Drupal\editor\Plugin\Filter\EditorFileReference->process('Now suppose that in the <em>Country</em> field of the <em>Geography</em> table we have the country in which the reseller who made each sale is located. Let's look at sales by country first. For this we simply take the measure that adds the sales (<em>Sales</em>) and the <em>Country</em> field to a table type display:
The <em>Sales</em> measure is summing the field that contains the sales figure, <em>SalesAmount</em>:
Sales = SUM(Sales[SalesAmount])
Now suppose that we want to be able to analyze sales in all countries other than the United States. A first option would be to use the <a href="/en/dax/function/calculate">CALCULATE</a> function to revalue the <em>Sales</em> measure:
Non USA sales = CALCULATE([Sales], Geography[Country] <> "United States")
We can take this new measure to a card type display to see the result:
The figure is correct, but if we take this measure to a table together with the <em>Country</em> field to show sales outside the United States segmented by country, the result is the following:
Of course, this is not what we wanted, but the CALCULATE function is modifying the context to always consider all countries other than the United States.
What we want is to be able to use the <em>SalesAmount</em> field that contains the sales figure but including only those sales records that do not correspond to resellers located in the United States. To begin with, we can build this table that only considers the countries of interest using the <a href="/en/dax/function/filter">FILTER</a> function. The pseudocode would be something like:
Filtered table = FILTER(
Sales,
Countries other than the United States
)
If the <em>Sales</em> table included a "<em>Country</em>" field, it would be enough to add <em>Country <> "United States"</em> instead of "<em>Countries other than the United States</em>", but it does not include it. This information relative to the country in which the reseller is located is in another table, the aforementioned <em>Geography</em> table, a table that is not directly accessible as an argument of the FILTER function. It is in this situation that the RELATED function comes in handy. Assuming that there is a relationship (of many-to-one or one-to-one type) between the sales table and the geography table, we can access from the first to the <em>Country</em> column of the second with the expression:
RELATED(Geography[Country])
Now the code for the filtered table would be as follows:
Filtered table = FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
)
As mentioned, the RELATED function requires a row context, which we can achieve using a table scan function like <a href="/en/dax/function/sumx">SUMX</a>, which is exactly what we are looking for to calculate total sales:
Sales non USA =
SUMX(
FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
),
Sales[SalesAmount]
)
What we are doing is adding the <em>SalesAmount</em> field for each of the rows of the filtered table, and this is composed of the set of sales records that do not have the United States associated as a country, but without excluding other possible filters that come given by the context.
In this way, if we take this measure to a card:
...we see that the total is correct. And if we take it to a table together with the <em>Country</em> field of <em>Geography</em>:
...we see that the measure is correctly adapted to the context, just as we wanted.
', 'en') (Line: 118)
Drupal\filter\Element\ProcessedText::preRenderText(Array)
call_user_func_array(Array, Array) (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 788)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 374)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 125)
__TwigTemplate_a7d6005c89ae729617b9a0c2bccb1776->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 46)
__TwigTemplate_804f7948456cfe20e11a34c43439c7c2->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 43)
__TwigTemplate_c80c0b77898c75587c022d0756404fc4->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/contrib/classy/templates/field/field--text-long.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('field', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 446)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 74)
__TwigTemplate_94047fbdba6937b76a4479dfa1763452->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/custom/yg_aesthetic/templates/node.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('node', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 242)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 235)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 132)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 174)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191)
Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 713)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
- Deprecated function: Creation of dynamic property Drupal\mysql\Driver\Database\mysql\Select::$alterTags is deprecated in Drupal\Core\Database\Query\Select->addTag() (line 149 of core/lib/Drupal/Core/Database/Query/Select.php).
Drupal\Core\Database\Query\Select->addTag('entity_query') (Line: 147)
Drupal\Core\Entity\Query\Sql\Query->prepare() (Line: 80)
Drupal\Core\Entity\Query\Sql\Query->execute() (Line: 640)
Drupal\Core\Entity\EntityStorageBase->loadByProperties(Array) (Line: 63)
Drupal\Core\Entity\EntityRepository->loadEntityByUuid('file', 'ca71f32d-85e4-4779-8378-41e8dd2026f1') (Line: 95)
Drupal\editor\Plugin\Filter\EditorFileReference->process('Now suppose that in the <em>Country</em> field of the <em>Geography</em> table we have the country in which the reseller who made each sale is located. Let's look at sales by country first. For this we simply take the measure that adds the sales (<em>Sales</em>) and the <em>Country</em> field to a table type display:
The <em>Sales</em> measure is summing the field that contains the sales figure, <em>SalesAmount</em>:
Sales = SUM(Sales[SalesAmount])
Now suppose that we want to be able to analyze sales in all countries other than the United States. A first option would be to use the <a href="/en/dax/function/calculate">CALCULATE</a> function to revalue the <em>Sales</em> measure:
Non USA sales = CALCULATE([Sales], Geography[Country] <> "United States")
We can take this new measure to a card type display to see the result:
The figure is correct, but if we take this measure to a table together with the <em>Country</em> field to show sales outside the United States segmented by country, the result is the following:
Of course, this is not what we wanted, but the CALCULATE function is modifying the context to always consider all countries other than the United States.
What we want is to be able to use the <em>SalesAmount</em> field that contains the sales figure but including only those sales records that do not correspond to resellers located in the United States. To begin with, we can build this table that only considers the countries of interest using the <a href="/en/dax/function/filter">FILTER</a> function. The pseudocode would be something like:
Filtered table = FILTER(
Sales,
Countries other than the United States
)
If the <em>Sales</em> table included a "<em>Country</em>" field, it would be enough to add <em>Country <> "United States"</em> instead of "<em>Countries other than the United States</em>", but it does not include it. This information relative to the country in which the reseller is located is in another table, the aforementioned <em>Geography</em> table, a table that is not directly accessible as an argument of the FILTER function. It is in this situation that the RELATED function comes in handy. Assuming that there is a relationship (of many-to-one or one-to-one type) between the sales table and the geography table, we can access from the first to the <em>Country</em> column of the second with the expression:
RELATED(Geography[Country])
Now the code for the filtered table would be as follows:
Filtered table = FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
)
As mentioned, the RELATED function requires a row context, which we can achieve using a table scan function like <a href="/en/dax/function/sumx">SUMX</a>, which is exactly what we are looking for to calculate total sales:
Sales non USA =
SUMX(
FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
),
Sales[SalesAmount]
)
What we are doing is adding the <em>SalesAmount</em> field for each of the rows of the filtered table, and this is composed of the set of sales records that do not have the United States associated as a country, but without excluding other possible filters that come given by the context.
In this way, if we take this measure to a card:
...we see that the total is correct. And if we take it to a table together with the <em>Country</em> field of <em>Geography</em>:
...we see that the measure is correctly adapted to the context, just as we wanted.
', 'en') (Line: 118)
Drupal\filter\Element\ProcessedText::preRenderText(Array)
call_user_func_array(Array, Array) (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 788)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 374)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 125)
__TwigTemplate_a7d6005c89ae729617b9a0c2bccb1776->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 46)
__TwigTemplate_804f7948456cfe20e11a34c43439c7c2->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 43)
__TwigTemplate_c80c0b77898c75587c022d0756404fc4->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/contrib/classy/templates/field/field--text-long.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('field', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 446)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 74)
__TwigTemplate_94047fbdba6937b76a4479dfa1763452->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/custom/yg_aesthetic/templates/node.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('node', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 242)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 235)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 132)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 174)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191)
Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 713)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
- Deprecated function: Creation of dynamic property Drupal\mysql\Driver\Database\mysql\Select::$alterTags is deprecated in Drupal\Core\Database\Query\Select->addTag() (line 149 of core/lib/Drupal/Core/Database/Query/Select.php).
Drupal\Core\Database\Query\Select->addTag('file_load_multiple') (Line: 696)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->buildQuery(Array) (Line: 422)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->getFromStorage(Array) (Line: 393)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->doLoadMultiple(Array) (Line: 346)
Drupal\Core\Entity\EntityStorageBase->loadMultiple(Array) (Line: 641)
Drupal\Core\Entity\EntityStorageBase->loadByProperties(Array) (Line: 63)
Drupal\Core\Entity\EntityRepository->loadEntityByUuid('file', 'ca71f32d-85e4-4779-8378-41e8dd2026f1') (Line: 95)
Drupal\editor\Plugin\Filter\EditorFileReference->process('Now suppose that in the <em>Country</em> field of the <em>Geography</em> table we have the country in which the reseller who made each sale is located. Let's look at sales by country first. For this we simply take the measure that adds the sales (<em>Sales</em>) and the <em>Country</em> field to a table type display:
The <em>Sales</em> measure is summing the field that contains the sales figure, <em>SalesAmount</em>:
Sales = SUM(Sales[SalesAmount])
Now suppose that we want to be able to analyze sales in all countries other than the United States. A first option would be to use the <a href="/en/dax/function/calculate">CALCULATE</a> function to revalue the <em>Sales</em> measure:
Non USA sales = CALCULATE([Sales], Geography[Country] <> "United States")
We can take this new measure to a card type display to see the result:
The figure is correct, but if we take this measure to a table together with the <em>Country</em> field to show sales outside the United States segmented by country, the result is the following:
Of course, this is not what we wanted, but the CALCULATE function is modifying the context to always consider all countries other than the United States.
What we want is to be able to use the <em>SalesAmount</em> field that contains the sales figure but including only those sales records that do not correspond to resellers located in the United States. To begin with, we can build this table that only considers the countries of interest using the <a href="/en/dax/function/filter">FILTER</a> function. The pseudocode would be something like:
Filtered table = FILTER(
Sales,
Countries other than the United States
)
If the <em>Sales</em> table included a "<em>Country</em>" field, it would be enough to add <em>Country <> "United States"</em> instead of "<em>Countries other than the United States</em>", but it does not include it. This information relative to the country in which the reseller is located is in another table, the aforementioned <em>Geography</em> table, a table that is not directly accessible as an argument of the FILTER function. It is in this situation that the RELATED function comes in handy. Assuming that there is a relationship (of many-to-one or one-to-one type) between the sales table and the geography table, we can access from the first to the <em>Country</em> column of the second with the expression:
RELATED(Geography[Country])
Now the code for the filtered table would be as follows:
Filtered table = FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
)
As mentioned, the RELATED function requires a row context, which we can achieve using a table scan function like <a href="/en/dax/function/sumx">SUMX</a>, which is exactly what we are looking for to calculate total sales:
Sales non USA =
SUMX(
FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
),
Sales[SalesAmount]
)
What we are doing is adding the <em>SalesAmount</em> field for each of the rows of the filtered table, and this is composed of the set of sales records that do not have the United States associated as a country, but without excluding other possible filters that come given by the context.
In this way, if we take this measure to a card:
...we see that the total is correct. And if we take it to a table together with the <em>Country</em> field of <em>Geography</em>:
...we see that the measure is correctly adapted to the context, just as we wanted.
', 'en') (Line: 118)
Drupal\filter\Element\ProcessedText::preRenderText(Array)
call_user_func_array(Array, Array) (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 788)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 374)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 125)
__TwigTemplate_a7d6005c89ae729617b9a0c2bccb1776->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 46)
__TwigTemplate_804f7948456cfe20e11a34c43439c7c2->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 43)
__TwigTemplate_c80c0b77898c75587c022d0756404fc4->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/contrib/classy/templates/field/field--text-long.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('field', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 446)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 74)
__TwigTemplate_94047fbdba6937b76a4479dfa1763452->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/custom/yg_aesthetic/templates/node.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('node', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 242)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 235)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 132)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 174)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191)
Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 713)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
- Deprecated function: Creation of dynamic property Drupal\mysql\Driver\Database\mysql\Select::$alterMetaData is deprecated in Drupal\Core\Database\Query\Select->addMetaData() (line 178 of core/lib/Drupal/Core/Database/Query/Select.php).
Drupal\Core\Database\Query\Select->addMetaData('entity_type', 'file') (Line: 115)
Drupal\Core\Entity\Query\Sql\Query->prepare() (Line: 80)
Drupal\Core\Entity\Query\Sql\Query->execute() (Line: 640)
Drupal\Core\Entity\EntityStorageBase->loadByProperties(Array) (Line: 63)
Drupal\Core\Entity\EntityRepository->loadEntityByUuid('file', 'ca71f32d-85e4-4779-8378-41e8dd2026f1') (Line: 124)
Drupal\editor\Plugin\Filter\EditorFileReference->process('Now suppose that in the <em>Country</em> field of the <em>Geography</em> table we have the country in which the reseller who made each sale is located. Let's look at sales by country first. For this we simply take the measure that adds the sales (<em>Sales</em>) and the <em>Country</em> field to a table type display:
The <em>Sales</em> measure is summing the field that contains the sales figure, <em>SalesAmount</em>:
Sales = SUM(Sales[SalesAmount])
Now suppose that we want to be able to analyze sales in all countries other than the United States. A first option would be to use the <a href="/en/dax/function/calculate">CALCULATE</a> function to revalue the <em>Sales</em> measure:
Non USA sales = CALCULATE([Sales], Geography[Country] <> "United States")
We can take this new measure to a card type display to see the result:
The figure is correct, but if we take this measure to a table together with the <em>Country</em> field to show sales outside the United States segmented by country, the result is the following:
Of course, this is not what we wanted, but the CALCULATE function is modifying the context to always consider all countries other than the United States.
What we want is to be able to use the <em>SalesAmount</em> field that contains the sales figure but including only those sales records that do not correspond to resellers located in the United States. To begin with, we can build this table that only considers the countries of interest using the <a href="/en/dax/function/filter">FILTER</a> function. The pseudocode would be something like:
Filtered table = FILTER(
Sales,
Countries other than the United States
)
If the <em>Sales</em> table included a "<em>Country</em>" field, it would be enough to add <em>Country <> "United States"</em> instead of "<em>Countries other than the United States</em>", but it does not include it. This information relative to the country in which the reseller is located is in another table, the aforementioned <em>Geography</em> table, a table that is not directly accessible as an argument of the FILTER function. It is in this situation that the RELATED function comes in handy. Assuming that there is a relationship (of many-to-one or one-to-one type) between the sales table and the geography table, we can access from the first to the <em>Country</em> column of the second with the expression:
RELATED(Geography[Country])
Now the code for the filtered table would be as follows:
Filtered table = FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
)
As mentioned, the RELATED function requires a row context, which we can achieve using a table scan function like <a href="/en/dax/function/sumx">SUMX</a>, which is exactly what we are looking for to calculate total sales:
Sales non USA =
SUMX(
FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
),
Sales[SalesAmount]
)
What we are doing is adding the <em>SalesAmount</em> field for each of the rows of the filtered table, and this is composed of the set of sales records that do not have the United States associated as a country, but without excluding other possible filters that come given by the context.
In this way, if we take this measure to a card:
...we see that the total is correct. And if we take it to a table together with the <em>Country</em> field of <em>Geography</em>:
...we see that the measure is correctly adapted to the context, just as we wanted.
', 'en') (Line: 118)
Drupal\filter\Element\ProcessedText::preRenderText(Array)
call_user_func_array(Array, Array) (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 788)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 374)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 125)
__TwigTemplate_a7d6005c89ae729617b9a0c2bccb1776->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 46)
__TwigTemplate_804f7948456cfe20e11a34c43439c7c2->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 43)
__TwigTemplate_c80c0b77898c75587c022d0756404fc4->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/contrib/classy/templates/field/field--text-long.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('field', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 446)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 74)
__TwigTemplate_94047fbdba6937b76a4479dfa1763452->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/custom/yg_aesthetic/templates/node.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('node', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 242)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 235)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 132)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 174)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191)
Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 713)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
- Deprecated function: Creation of dynamic property Drupal\mysql\Driver\Database\mysql\Select::$alterTags is deprecated in Drupal\Core\Database\Query\Select->addTag() (line 149 of core/lib/Drupal/Core/Database/Query/Select.php).
Drupal\Core\Database\Query\Select->addTag('entity_query') (Line: 147)
Drupal\Core\Entity\Query\Sql\Query->prepare() (Line: 80)
Drupal\Core\Entity\Query\Sql\Query->execute() (Line: 640)
Drupal\Core\Entity\EntityStorageBase->loadByProperties(Array) (Line: 63)
Drupal\Core\Entity\EntityRepository->loadEntityByUuid('file', 'ca71f32d-85e4-4779-8378-41e8dd2026f1') (Line: 124)
Drupal\editor\Plugin\Filter\EditorFileReference->process('Now suppose that in the <em>Country</em> field of the <em>Geography</em> table we have the country in which the reseller who made each sale is located. Let's look at sales by country first. For this we simply take the measure that adds the sales (<em>Sales</em>) and the <em>Country</em> field to a table type display:
The <em>Sales</em> measure is summing the field that contains the sales figure, <em>SalesAmount</em>:
Sales = SUM(Sales[SalesAmount])
Now suppose that we want to be able to analyze sales in all countries other than the United States. A first option would be to use the <a href="/en/dax/function/calculate">CALCULATE</a> function to revalue the <em>Sales</em> measure:
Non USA sales = CALCULATE([Sales], Geography[Country] <> "United States")
We can take this new measure to a card type display to see the result:
The figure is correct, but if we take this measure to a table together with the <em>Country</em> field to show sales outside the United States segmented by country, the result is the following:
Of course, this is not what we wanted, but the CALCULATE function is modifying the context to always consider all countries other than the United States.
What we want is to be able to use the <em>SalesAmount</em> field that contains the sales figure but including only those sales records that do not correspond to resellers located in the United States. To begin with, we can build this table that only considers the countries of interest using the <a href="/en/dax/function/filter">FILTER</a> function. The pseudocode would be something like:
Filtered table = FILTER(
Sales,
Countries other than the United States
)
If the <em>Sales</em> table included a "<em>Country</em>" field, it would be enough to add <em>Country <> "United States"</em> instead of "<em>Countries other than the United States</em>", but it does not include it. This information relative to the country in which the reseller is located is in another table, the aforementioned <em>Geography</em> table, a table that is not directly accessible as an argument of the FILTER function. It is in this situation that the RELATED function comes in handy. Assuming that there is a relationship (of many-to-one or one-to-one type) between the sales table and the geography table, we can access from the first to the <em>Country</em> column of the second with the expression:
RELATED(Geography[Country])
Now the code for the filtered table would be as follows:
Filtered table = FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
)
As mentioned, the RELATED function requires a row context, which we can achieve using a table scan function like <a href="/en/dax/function/sumx">SUMX</a>, which is exactly what we are looking for to calculate total sales:
Sales non USA =
SUMX(
FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
),
Sales[SalesAmount]
)
What we are doing is adding the <em>SalesAmount</em> field for each of the rows of the filtered table, and this is composed of the set of sales records that do not have the United States associated as a country, but without excluding other possible filters that come given by the context.
In this way, if we take this measure to a card:
...we see that the total is correct. And if we take it to a table together with the <em>Country</em> field of <em>Geography</em>:
...we see that the measure is correctly adapted to the context, just as we wanted.
', 'en') (Line: 118)
Drupal\filter\Element\ProcessedText::preRenderText(Array)
call_user_func_array(Array, Array) (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 788)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 374)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 125)
__TwigTemplate_a7d6005c89ae729617b9a0c2bccb1776->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 46)
__TwigTemplate_804f7948456cfe20e11a34c43439c7c2->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 43)
__TwigTemplate_c80c0b77898c75587c022d0756404fc4->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/contrib/classy/templates/field/field--text-long.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('field', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 446)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 74)
__TwigTemplate_94047fbdba6937b76a4479dfa1763452->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/custom/yg_aesthetic/templates/node.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('node', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 242)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 235)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 132)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 174)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191)
Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 713)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
- Deprecated function: Creation of dynamic property Drupal\mysql\Driver\Database\mysql\Select::$alterMetaData is deprecated in Drupal\Core\Database\Query\Select->addMetaData() (line 178 of core/lib/Drupal/Core/Database/Query/Select.php).
Drupal\Core\Database\Query\Select->addMetaData('entity_type', 'file') (Line: 115)
Drupal\Core\Entity\Query\Sql\Query->prepare() (Line: 80)
Drupal\Core\Entity\Query\Sql\Query->execute() (Line: 640)
Drupal\Core\Entity\EntityStorageBase->loadByProperties(Array) (Line: 63)
Drupal\Core\Entity\EntityRepository->loadEntityByUuid('file', 'e0c816a0-89ef-4da7-aa01-b1b7ac62009c') (Line: 95)
Drupal\editor\Plugin\Filter\EditorFileReference->process('Now suppose that in the <em>Country</em> field of the <em>Geography</em> table we have the country in which the reseller who made each sale is located. Let's look at sales by country first. For this we simply take the measure that adds the sales (<em>Sales</em>) and the <em>Country</em> field to a table type display:
The <em>Sales</em> measure is summing the field that contains the sales figure, <em>SalesAmount</em>:
Sales = SUM(Sales[SalesAmount])
Now suppose that we want to be able to analyze sales in all countries other than the United States. A first option would be to use the <a href="/en/dax/function/calculate">CALCULATE</a> function to revalue the <em>Sales</em> measure:
Non USA sales = CALCULATE([Sales], Geography[Country] <> "United States")
We can take this new measure to a card type display to see the result:
The figure is correct, but if we take this measure to a table together with the <em>Country</em> field to show sales outside the United States segmented by country, the result is the following:
Of course, this is not what we wanted, but the CALCULATE function is modifying the context to always consider all countries other than the United States.
What we want is to be able to use the <em>SalesAmount</em> field that contains the sales figure but including only those sales records that do not correspond to resellers located in the United States. To begin with, we can build this table that only considers the countries of interest using the <a href="/en/dax/function/filter">FILTER</a> function. The pseudocode would be something like:
Filtered table = FILTER(
Sales,
Countries other than the United States
)
If the <em>Sales</em> table included a "<em>Country</em>" field, it would be enough to add <em>Country <> "United States"</em> instead of "<em>Countries other than the United States</em>", but it does not include it. This information relative to the country in which the reseller is located is in another table, the aforementioned <em>Geography</em> table, a table that is not directly accessible as an argument of the FILTER function. It is in this situation that the RELATED function comes in handy. Assuming that there is a relationship (of many-to-one or one-to-one type) between the sales table and the geography table, we can access from the first to the <em>Country</em> column of the second with the expression:
RELATED(Geography[Country])
Now the code for the filtered table would be as follows:
Filtered table = FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
)
As mentioned, the RELATED function requires a row context, which we can achieve using a table scan function like <a href="/en/dax/function/sumx">SUMX</a>, which is exactly what we are looking for to calculate total sales:
Sales non USA =
SUMX(
FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
),
Sales[SalesAmount]
)
What we are doing is adding the <em>SalesAmount</em> field for each of the rows of the filtered table, and this is composed of the set of sales records that do not have the United States associated as a country, but without excluding other possible filters that come given by the context.
In this way, if we take this measure to a card:
...we see that the total is correct. And if we take it to a table together with the <em>Country</em> field of <em>Geography</em>:
...we see that the measure is correctly adapted to the context, just as we wanted.
', 'en') (Line: 118)
Drupal\filter\Element\ProcessedText::preRenderText(Array)
call_user_func_array(Array, Array) (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 788)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 374)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 125)
__TwigTemplate_a7d6005c89ae729617b9a0c2bccb1776->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 46)
__TwigTemplate_804f7948456cfe20e11a34c43439c7c2->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 43)
__TwigTemplate_c80c0b77898c75587c022d0756404fc4->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/contrib/classy/templates/field/field--text-long.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('field', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 446)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 74)
__TwigTemplate_94047fbdba6937b76a4479dfa1763452->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/custom/yg_aesthetic/templates/node.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('node', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 242)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 235)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 132)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 174)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191)
Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 713)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
- Deprecated function: Creation of dynamic property Drupal\mysql\Driver\Database\mysql\Select::$alterTags is deprecated in Drupal\Core\Database\Query\Select->addTag() (line 149 of core/lib/Drupal/Core/Database/Query/Select.php).
Drupal\Core\Database\Query\Select->addTag('entity_query') (Line: 147)
Drupal\Core\Entity\Query\Sql\Query->prepare() (Line: 80)
Drupal\Core\Entity\Query\Sql\Query->execute() (Line: 640)
Drupal\Core\Entity\EntityStorageBase->loadByProperties(Array) (Line: 63)
Drupal\Core\Entity\EntityRepository->loadEntityByUuid('file', 'e0c816a0-89ef-4da7-aa01-b1b7ac62009c') (Line: 95)
Drupal\editor\Plugin\Filter\EditorFileReference->process('Now suppose that in the <em>Country</em> field of the <em>Geography</em> table we have the country in which the reseller who made each sale is located. Let's look at sales by country first. For this we simply take the measure that adds the sales (<em>Sales</em>) and the <em>Country</em> field to a table type display:
The <em>Sales</em> measure is summing the field that contains the sales figure, <em>SalesAmount</em>:
Sales = SUM(Sales[SalesAmount])
Now suppose that we want to be able to analyze sales in all countries other than the United States. A first option would be to use the <a href="/en/dax/function/calculate">CALCULATE</a> function to revalue the <em>Sales</em> measure:
Non USA sales = CALCULATE([Sales], Geography[Country] <> "United States")
We can take this new measure to a card type display to see the result:
The figure is correct, but if we take this measure to a table together with the <em>Country</em> field to show sales outside the United States segmented by country, the result is the following:
Of course, this is not what we wanted, but the CALCULATE function is modifying the context to always consider all countries other than the United States.
What we want is to be able to use the <em>SalesAmount</em> field that contains the sales figure but including only those sales records that do not correspond to resellers located in the United States. To begin with, we can build this table that only considers the countries of interest using the <a href="/en/dax/function/filter">FILTER</a> function. The pseudocode would be something like:
Filtered table = FILTER(
Sales,
Countries other than the United States
)
If the <em>Sales</em> table included a "<em>Country</em>" field, it would be enough to add <em>Country <> "United States"</em> instead of "<em>Countries other than the United States</em>", but it does not include it. This information relative to the country in which the reseller is located is in another table, the aforementioned <em>Geography</em> table, a table that is not directly accessible as an argument of the FILTER function. It is in this situation that the RELATED function comes in handy. Assuming that there is a relationship (of many-to-one or one-to-one type) between the sales table and the geography table, we can access from the first to the <em>Country</em> column of the second with the expression:
RELATED(Geography[Country])
Now the code for the filtered table would be as follows:
Filtered table = FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
)
As mentioned, the RELATED function requires a row context, which we can achieve using a table scan function like <a href="/en/dax/function/sumx">SUMX</a>, which is exactly what we are looking for to calculate total sales:
Sales non USA =
SUMX(
FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
),
Sales[SalesAmount]
)
What we are doing is adding the <em>SalesAmount</em> field for each of the rows of the filtered table, and this is composed of the set of sales records that do not have the United States associated as a country, but without excluding other possible filters that come given by the context.
In this way, if we take this measure to a card:
...we see that the total is correct. And if we take it to a table together with the <em>Country</em> field of <em>Geography</em>:
...we see that the measure is correctly adapted to the context, just as we wanted.
', 'en') (Line: 118)
Drupal\filter\Element\ProcessedText::preRenderText(Array)
call_user_func_array(Array, Array) (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 788)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 374)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 125)
__TwigTemplate_a7d6005c89ae729617b9a0c2bccb1776->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 46)
__TwigTemplate_804f7948456cfe20e11a34c43439c7c2->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 43)
__TwigTemplate_c80c0b77898c75587c022d0756404fc4->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/contrib/classy/templates/field/field--text-long.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('field', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 446)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 74)
__TwigTemplate_94047fbdba6937b76a4479dfa1763452->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/custom/yg_aesthetic/templates/node.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('node', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 242)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 235)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 132)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 174)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191)
Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 713)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
- Deprecated function: Creation of dynamic property Drupal\mysql\Driver\Database\mysql\Select::$alterTags is deprecated in Drupal\Core\Database\Query\Select->addTag() (line 149 of core/lib/Drupal/Core/Database/Query/Select.php).
Drupal\Core\Database\Query\Select->addTag('file_load_multiple') (Line: 696)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->buildQuery(Array) (Line: 422)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->getFromStorage(Array) (Line: 393)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->doLoadMultiple(Array) (Line: 346)
Drupal\Core\Entity\EntityStorageBase->loadMultiple(Array) (Line: 641)
Drupal\Core\Entity\EntityStorageBase->loadByProperties(Array) (Line: 63)
Drupal\Core\Entity\EntityRepository->loadEntityByUuid('file', 'e0c816a0-89ef-4da7-aa01-b1b7ac62009c') (Line: 95)
Drupal\editor\Plugin\Filter\EditorFileReference->process('Now suppose that in the <em>Country</em> field of the <em>Geography</em> table we have the country in which the reseller who made each sale is located. Let's look at sales by country first. For this we simply take the measure that adds the sales (<em>Sales</em>) and the <em>Country</em> field to a table type display:
The <em>Sales</em> measure is summing the field that contains the sales figure, <em>SalesAmount</em>:
Sales = SUM(Sales[SalesAmount])
Now suppose that we want to be able to analyze sales in all countries other than the United States. A first option would be to use the <a href="/en/dax/function/calculate">CALCULATE</a> function to revalue the <em>Sales</em> measure:
Non USA sales = CALCULATE([Sales], Geography[Country] <> "United States")
We can take this new measure to a card type display to see the result:
The figure is correct, but if we take this measure to a table together with the <em>Country</em> field to show sales outside the United States segmented by country, the result is the following:
Of course, this is not what we wanted, but the CALCULATE function is modifying the context to always consider all countries other than the United States.
What we want is to be able to use the <em>SalesAmount</em> field that contains the sales figure but including only those sales records that do not correspond to resellers located in the United States. To begin with, we can build this table that only considers the countries of interest using the <a href="/en/dax/function/filter">FILTER</a> function. The pseudocode would be something like:
Filtered table = FILTER(
Sales,
Countries other than the United States
)
If the <em>Sales</em> table included a "<em>Country</em>" field, it would be enough to add <em>Country <> "United States"</em> instead of "<em>Countries other than the United States</em>", but it does not include it. This information relative to the country in which the reseller is located is in another table, the aforementioned <em>Geography</em> table, a table that is not directly accessible as an argument of the FILTER function. It is in this situation that the RELATED function comes in handy. Assuming that there is a relationship (of many-to-one or one-to-one type) between the sales table and the geography table, we can access from the first to the <em>Country</em> column of the second with the expression:
RELATED(Geography[Country])
Now the code for the filtered table would be as follows:
Filtered table = FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
)
As mentioned, the RELATED function requires a row context, which we can achieve using a table scan function like <a href="/en/dax/function/sumx">SUMX</a>, which is exactly what we are looking for to calculate total sales:
Sales non USA =
SUMX(
FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
),
Sales[SalesAmount]
)
What we are doing is adding the <em>SalesAmount</em> field for each of the rows of the filtered table, and this is composed of the set of sales records that do not have the United States associated as a country, but without excluding other possible filters that come given by the context.
In this way, if we take this measure to a card:
...we see that the total is correct. And if we take it to a table together with the <em>Country</em> field of <em>Geography</em>:
...we see that the measure is correctly adapted to the context, just as we wanted.
', 'en') (Line: 118)
Drupal\filter\Element\ProcessedText::preRenderText(Array)
call_user_func_array(Array, Array) (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 788)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 374)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 125)
__TwigTemplate_a7d6005c89ae729617b9a0c2bccb1776->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 46)
__TwigTemplate_804f7948456cfe20e11a34c43439c7c2->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 43)
__TwigTemplate_c80c0b77898c75587c022d0756404fc4->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/contrib/classy/templates/field/field--text-long.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('field', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 446)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 74)
__TwigTemplate_94047fbdba6937b76a4479dfa1763452->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/custom/yg_aesthetic/templates/node.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('node', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 242)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 235)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 132)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 174)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191)
Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 713)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
- Deprecated function: Creation of dynamic property Drupal\mysql\Driver\Database\mysql\Select::$alterMetaData is deprecated in Drupal\Core\Database\Query\Select->addMetaData() (line 178 of core/lib/Drupal/Core/Database/Query/Select.php).
Drupal\Core\Database\Query\Select->addMetaData('entity_type', 'file') (Line: 115)
Drupal\Core\Entity\Query\Sql\Query->prepare() (Line: 80)
Drupal\Core\Entity\Query\Sql\Query->execute() (Line: 640)
Drupal\Core\Entity\EntityStorageBase->loadByProperties(Array) (Line: 63)
Drupal\Core\Entity\EntityRepository->loadEntityByUuid('file', 'e0c816a0-89ef-4da7-aa01-b1b7ac62009c') (Line: 124)
Drupal\editor\Plugin\Filter\EditorFileReference->process('Now suppose that in the <em>Country</em> field of the <em>Geography</em> table we have the country in which the reseller who made each sale is located. Let's look at sales by country first. For this we simply take the measure that adds the sales (<em>Sales</em>) and the <em>Country</em> field to a table type display:
The <em>Sales</em> measure is summing the field that contains the sales figure, <em>SalesAmount</em>:
Sales = SUM(Sales[SalesAmount])
Now suppose that we want to be able to analyze sales in all countries other than the United States. A first option would be to use the <a href="/en/dax/function/calculate">CALCULATE</a> function to revalue the <em>Sales</em> measure:
Non USA sales = CALCULATE([Sales], Geography[Country] <> "United States")
We can take this new measure to a card type display to see the result:
The figure is correct, but if we take this measure to a table together with the <em>Country</em> field to show sales outside the United States segmented by country, the result is the following:
Of course, this is not what we wanted, but the CALCULATE function is modifying the context to always consider all countries other than the United States.
What we want is to be able to use the <em>SalesAmount</em> field that contains the sales figure but including only those sales records that do not correspond to resellers located in the United States. To begin with, we can build this table that only considers the countries of interest using the <a href="/en/dax/function/filter">FILTER</a> function. The pseudocode would be something like:
Filtered table = FILTER(
Sales,
Countries other than the United States
)
If the <em>Sales</em> table included a "<em>Country</em>" field, it would be enough to add <em>Country <> "United States"</em> instead of "<em>Countries other than the United States</em>", but it does not include it. This information relative to the country in which the reseller is located is in another table, the aforementioned <em>Geography</em> table, a table that is not directly accessible as an argument of the FILTER function. It is in this situation that the RELATED function comes in handy. Assuming that there is a relationship (of many-to-one or one-to-one type) between the sales table and the geography table, we can access from the first to the <em>Country</em> column of the second with the expression:
RELATED(Geography[Country])
Now the code for the filtered table would be as follows:
Filtered table = FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
)
As mentioned, the RELATED function requires a row context, which we can achieve using a table scan function like <a href="/en/dax/function/sumx">SUMX</a>, which is exactly what we are looking for to calculate total sales:
Sales non USA =
SUMX(
FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
),
Sales[SalesAmount]
)
What we are doing is adding the <em>SalesAmount</em> field for each of the rows of the filtered table, and this is composed of the set of sales records that do not have the United States associated as a country, but without excluding other possible filters that come given by the context.
In this way, if we take this measure to a card:
...we see that the total is correct. And if we take it to a table together with the <em>Country</em> field of <em>Geography</em>:
...we see that the measure is correctly adapted to the context, just as we wanted.
', 'en') (Line: 118)
Drupal\filter\Element\ProcessedText::preRenderText(Array)
call_user_func_array(Array, Array) (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 788)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 374)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 125)
__TwigTemplate_a7d6005c89ae729617b9a0c2bccb1776->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 46)
__TwigTemplate_804f7948456cfe20e11a34c43439c7c2->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 43)
__TwigTemplate_c80c0b77898c75587c022d0756404fc4->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/contrib/classy/templates/field/field--text-long.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('field', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 446)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 74)
__TwigTemplate_94047fbdba6937b76a4479dfa1763452->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/custom/yg_aesthetic/templates/node.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('node', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 242)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 235)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 132)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 174)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191)
Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 713)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
- Deprecated function: Creation of dynamic property Drupal\mysql\Driver\Database\mysql\Select::$alterTags is deprecated in Drupal\Core\Database\Query\Select->addTag() (line 149 of core/lib/Drupal/Core/Database/Query/Select.php).
Drupal\Core\Database\Query\Select->addTag('entity_query') (Line: 147)
Drupal\Core\Entity\Query\Sql\Query->prepare() (Line: 80)
Drupal\Core\Entity\Query\Sql\Query->execute() (Line: 640)
Drupal\Core\Entity\EntityStorageBase->loadByProperties(Array) (Line: 63)
Drupal\Core\Entity\EntityRepository->loadEntityByUuid('file', 'e0c816a0-89ef-4da7-aa01-b1b7ac62009c') (Line: 124)
Drupal\editor\Plugin\Filter\EditorFileReference->process('Now suppose that in the <em>Country</em> field of the <em>Geography</em> table we have the country in which the reseller who made each sale is located. Let's look at sales by country first. For this we simply take the measure that adds the sales (<em>Sales</em>) and the <em>Country</em> field to a table type display:
The <em>Sales</em> measure is summing the field that contains the sales figure, <em>SalesAmount</em>:
Sales = SUM(Sales[SalesAmount])
Now suppose that we want to be able to analyze sales in all countries other than the United States. A first option would be to use the <a href="/en/dax/function/calculate">CALCULATE</a> function to revalue the <em>Sales</em> measure:
Non USA sales = CALCULATE([Sales], Geography[Country] <> "United States")
We can take this new measure to a card type display to see the result:
The figure is correct, but if we take this measure to a table together with the <em>Country</em> field to show sales outside the United States segmented by country, the result is the following:
Of course, this is not what we wanted, but the CALCULATE function is modifying the context to always consider all countries other than the United States.
What we want is to be able to use the <em>SalesAmount</em> field that contains the sales figure but including only those sales records that do not correspond to resellers located in the United States. To begin with, we can build this table that only considers the countries of interest using the <a href="/en/dax/function/filter">FILTER</a> function. The pseudocode would be something like:
Filtered table = FILTER(
Sales,
Countries other than the United States
)
If the <em>Sales</em> table included a "<em>Country</em>" field, it would be enough to add <em>Country <> "United States"</em> instead of "<em>Countries other than the United States</em>", but it does not include it. This information relative to the country in which the reseller is located is in another table, the aforementioned <em>Geography</em> table, a table that is not directly accessible as an argument of the FILTER function. It is in this situation that the RELATED function comes in handy. Assuming that there is a relationship (of many-to-one or one-to-one type) between the sales table and the geography table, we can access from the first to the <em>Country</em> column of the second with the expression:
RELATED(Geography[Country])
Now the code for the filtered table would be as follows:
Filtered table = FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
)
As mentioned, the RELATED function requires a row context, which we can achieve using a table scan function like <a href="/en/dax/function/sumx">SUMX</a>, which is exactly what we are looking for to calculate total sales:
Sales non USA =
SUMX(
FILTER(
Sales,
RELATED(Geography[Country]) <> "United States"
),
Sales[SalesAmount]
)
What we are doing is adding the <em>SalesAmount</em> field for each of the rows of the filtered table, and this is composed of the set of sales records that do not have the United States associated as a country, but without excluding other possible filters that come given by the context.
In this way, if we take this measure to a card:
...we see that the total is correct. And if we take it to a table together with the <em>Country</em> field of <em>Geography</em>:
...we see that the measure is correctly adapted to the context, just as we wanted.
', 'en') (Line: 118)
Drupal\filter\Element\ProcessedText::preRenderText(Array)
call_user_func_array(Array, Array) (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 788)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 374)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 125)
__TwigTemplate_a7d6005c89ae729617b9a0c2bccb1776->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 46)
__TwigTemplate_804f7948456cfe20e11a34c43439c7c2->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array, Array) (Line: 43)
__TwigTemplate_c80c0b77898c75587c022d0756404fc4->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/contrib/classy/templates/field/field--text-long.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('field', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 446)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 74)
__TwigTemplate_94047fbdba6937b76a4479dfa1763452->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/custom/yg_aesthetic/templates/node.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('node', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 242)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 235)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 132)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 174)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191)
Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 713)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
- Deprecated function: Return type of Drupal\google_analytics\Component\Render\GoogleAnalyticsJavaScriptSnippet::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in include() (line 10 of modules/contrib/google_analytics/src/Component/Render/GoogleAnalyticsJavaScriptSnippet.php).
include('/var/www/vhosts/interactivechaos.ovh/httpdocs/modules/contrib/google_analytics/src/Component/Render/GoogleAnalyticsJavaScriptSnippet.php') (Line: 578)
Composer\Autoload\ClassLoader::Composer\Autoload\{closure}('/var/www/vhosts/interactivechaos.ovh/httpdocs/modules/contrib/google_analytics/src/Component/Render/GoogleAnalyticsJavaScriptSnippet.php') (Line: 432)
Composer\Autoload\ClassLoader->loadClass('Drupal\google_analytics\Component\Render\GoogleAnalyticsJavaScriptSnippet') (Line: 372)
google_analytics_page_attachments(Array) (Line: 313)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}(Object, 'google_analytics') (Line: 405)
Drupal\Core\Extension\ModuleHandler->invokeAllWith('page_attachments', Object) (Line: 310)
Drupal\Core\Render\MainContent\HtmlRenderer->invokePageAttachmentHooks(Array) (Line: 288)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 132)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 174)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191)
Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 713)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
- Deprecated function: Use of "static" in callables is deprecated in Drupal\user\Entity\Role::postLoad() (line 172 of core/modules/user/src/Entity/Role.php).
Drupal\user\Entity\Role::postLoad(Object, Array) (Line: 423)
Drupal\Core\Entity\EntityStorageBase->postLoad(Array) (Line: 353)
Drupal\Core\Entity\EntityStorageBase->loadMultiple() (Line: 126)
eu_cookie_compliance_page_attachments(Array) (Line: 313)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}(Object, 'eu_cookie_compliance') (Line: 405)
Drupal\Core\Extension\ModuleHandler->invokeAllWith('page_attachments', Object) (Line: 310)
Drupal\Core\Render\MainContent\HtmlRenderer->invokePageAttachmentHooks(Array) (Line: 288)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 132)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 174)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191)
Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 713)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
- Deprecated function: Creation of dynamic property Drupal\views\ManyToOneHelper::$handler is deprecated in Drupal\views\ManyToOneHelper->__construct() (line 24 of core/modules/views/src/ManyToOneHelper.php).
Drupal\views\ManyToOneHelper->__construct(Object) (Line: 51)
Drupal\views\Plugin\views\filter\ManyToOne->defineOptions() (Line: 141)
Drupal\views\Plugin\views\PluginBase->init(Object, Object, Array) (Line: 104)
Drupal\views\Plugin\views\HandlerBase->init(Object, Object, Array) (Line: 95)
Drupal\views\Plugin\views\filter\FilterPluginBase->init(Object, Object, Array) (Line: 44)
Drupal\views\Plugin\views\filter\InOperator->init(Object, Object, Array) (Line: 36)
Drupal\views\Plugin\views\filter\ManyToOne->init(Object, Object, Array) (Line: 25)
Drupal\options\Plugin\views\filter\ListField->init(Object, Object, Array) (Line: 894)
Drupal\views\Plugin\views\display\DisplayPluginBase->getHandlers('filter') (Line: 1045)
Drupal\views\ViewExecutable->_initHandler('filter', Array) (Line: 903)
Drupal\views\ViewExecutable->initHandlers() (Line: 2633)
Drupal\views\Plugin\views\display\DisplayPluginBase->viewExposedFormBlocks() (Line: 35)
Drupal\views\Plugin\Block\ViewsExposedFilterBlock->build() (Line: 171)
Drupal\block\BlockViewBuilder::preRender(Array)
call_user_func_array(Array, Array) (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 788)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 374)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 446)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 302)
__TwigTemplate_c8b006727765bdbd2647614d70488e6c->block_sidebar_first(Array, Array) (Line: 182)
Twig\Template->displayBlock('sidebar_first', Array, Array) (Line: 178)
__TwigTemplate_c8b006727765bdbd2647614d70488e6c->block_main(Array, Array) (Line: 182)
Twig\Template->displayBlock('main', Array, Array) (Line: 87)
__TwigTemplate_c8b006727765bdbd2647614d70488e6c->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/custom/yg_aesthetic/templates/page.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('page', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 97)
__TwigTemplate_ed8fa9c8f2c296c9becadea6e6efe774->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/custom/yg_aesthetic/templates/html.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('html', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 162)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 157)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 174)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191)
Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 713)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
- Deprecated function: Creation of dynamic property Drupal\views\ManyToOneHelper::$handler is deprecated in Drupal\views\ManyToOneHelper->__construct() (line 24 of core/modules/views/src/ManyToOneHelper.php).
Drupal\views\ManyToOneHelper->__construct(Object) (Line: 51)
Drupal\views\Plugin\views\filter\ManyToOne->defineOptions() (Line: 228)
Drupal\views\Plugin\views\PluginBase->unpackOptions(Array, Array) (Line: 144)
Drupal\views\Plugin\views\PluginBase->init(Object, Object, Array) (Line: 104)
Drupal\views\Plugin\views\HandlerBase->init(Object, Object, Array) (Line: 95)
Drupal\views\Plugin\views\filter\FilterPluginBase->init(Object, Object, Array) (Line: 44)
Drupal\views\Plugin\views\filter\InOperator->init(Object, Object, Array) (Line: 36)
Drupal\views\Plugin\views\filter\ManyToOne->init(Object, Object, Array) (Line: 25)
Drupal\options\Plugin\views\filter\ListField->init(Object, Object, Array) (Line: 894)
Drupal\views\Plugin\views\display\DisplayPluginBase->getHandlers('filter') (Line: 1045)
Drupal\views\ViewExecutable->_initHandler('filter', Array) (Line: 903)
Drupal\views\ViewExecutable->initHandlers() (Line: 2633)
Drupal\views\Plugin\views\display\DisplayPluginBase->viewExposedFormBlocks() (Line: 35)
Drupal\views\Plugin\Block\ViewsExposedFilterBlock->build() (Line: 171)
Drupal\block\BlockViewBuilder::preRender(Array)
call_user_func_array(Array, Array) (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 788)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 374)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 446)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 302)
__TwigTemplate_c8b006727765bdbd2647614d70488e6c->block_sidebar_first(Array, Array) (Line: 182)
Twig\Template->displayBlock('sidebar_first', Array, Array) (Line: 178)
__TwigTemplate_c8b006727765bdbd2647614d70488e6c->block_main(Array, Array) (Line: 182)
Twig\Template->displayBlock('main', Array, Array) (Line: 87)
__TwigTemplate_c8b006727765bdbd2647614d70488e6c->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/custom/yg_aesthetic/templates/page.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('page', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 97)
__TwigTemplate_ed8fa9c8f2c296c9becadea6e6efe774->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/custom/yg_aesthetic/templates/html.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('html', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 162)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 157)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 174)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191)
Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 713)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
- Deprecated function: Creation of dynamic property Drupal\views\ManyToOneHelper::$handler is deprecated in Drupal\views\ManyToOneHelper->__construct() (line 24 of core/modules/views/src/ManyToOneHelper.php).
Drupal\views\ManyToOneHelper->__construct(Object) (Line: 51)
Drupal\views\Plugin\views\filter\ManyToOne->defineOptions() (Line: 228)
Drupal\views\Plugin\views\PluginBase->unpackOptions(Array, Array) (Line: 110)
Drupal\views\Plugin\views\HandlerBase->init(Object, Object, Array) (Line: 95)
Drupal\views\Plugin\views\filter\FilterPluginBase->init(Object, Object, Array) (Line: 44)
Drupal\views\Plugin\views\filter\InOperator->init(Object, Object, Array) (Line: 36)
Drupal\views\Plugin\views\filter\ManyToOne->init(Object, Object, Array) (Line: 25)
Drupal\options\Plugin\views\filter\ListField->init(Object, Object, Array) (Line: 894)
Drupal\views\Plugin\views\display\DisplayPluginBase->getHandlers('filter') (Line: 1045)
Drupal\views\ViewExecutable->_initHandler('filter', Array) (Line: 903)
Drupal\views\ViewExecutable->initHandlers() (Line: 2633)
Drupal\views\Plugin\views\display\DisplayPluginBase->viewExposedFormBlocks() (Line: 35)
Drupal\views\Plugin\Block\ViewsExposedFilterBlock->build() (Line: 171)
Drupal\block\BlockViewBuilder::preRender(Array)
call_user_func_array(Array, Array) (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 788)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 374)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 446)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 302)
__TwigTemplate_c8b006727765bdbd2647614d70488e6c->block_sidebar_first(Array, Array) (Line: 182)
Twig\Template->displayBlock('sidebar_first', Array, Array) (Line: 178)
__TwigTemplate_c8b006727765bdbd2647614d70488e6c->block_main(Array, Array) (Line: 182)
Twig\Template->displayBlock('main', Array, Array) (Line: 87)
__TwigTemplate_c8b006727765bdbd2647614d70488e6c->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/custom/yg_aesthetic/templates/page.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('page', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 97)
__TwigTemplate_ed8fa9c8f2c296c9becadea6e6efe774->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/custom/yg_aesthetic/templates/html.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('html', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 162)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 157)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 174)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191)
Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 713)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
- Deprecated function: Creation of dynamic property Drupal\views\ManyToOneHelper::$handler is deprecated in Drupal\views\ManyToOneHelper->__construct() (line 24 of core/modules/views/src/ManyToOneHelper.php).
Drupal\views\ManyToOneHelper->__construct(Object) (Line: 38)
Drupal\views\Plugin\views\filter\ManyToOne->init(Object, Object, Array) (Line: 25)
Drupal\options\Plugin\views\filter\ListField->init(Object, Object, Array) (Line: 894)
Drupal\views\Plugin\views\display\DisplayPluginBase->getHandlers('filter') (Line: 1045)
Drupal\views\ViewExecutable->_initHandler('filter', Array) (Line: 903)
Drupal\views\ViewExecutable->initHandlers() (Line: 2633)
Drupal\views\Plugin\views\display\DisplayPluginBase->viewExposedFormBlocks() (Line: 35)
Drupal\views\Plugin\Block\ViewsExposedFilterBlock->build() (Line: 171)
Drupal\block\BlockViewBuilder::preRender(Array)
call_user_func_array(Array, Array) (Line: 101)
Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_render callbacks must be methods of a class that implements \Drupal\Core\Security\TrustedCallbackInterface or be an anonymous function. The callback was %s. See https://www.drupal.org/node/2966725', 'exception', 'Drupal\Core\Render\Element\RenderCallbackInterface') (Line: 788)
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 374)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 446)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 302)
__TwigTemplate_c8b006727765bdbd2647614d70488e6c->block_sidebar_first(Array, Array) (Line: 182)
Twig\Template->displayBlock('sidebar_first', Array, Array) (Line: 178)
__TwigTemplate_c8b006727765bdbd2647614d70488e6c->block_main(Array, Array) (Line: 182)
Twig\Template->displayBlock('main', Array, Array) (Line: 87)
__TwigTemplate_c8b006727765bdbd2647614d70488e6c->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/custom/yg_aesthetic/templates/page.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('page', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 479)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 97)
__TwigTemplate_ed8fa9c8f2c296c9becadea6e6efe774->doDisplay(Array, Array) (Line: 405)
Twig\Template->displayWithErrorHandling(Array, Array) (Line: 378)
Twig\Template->display(Array) (Line: 390)
Twig\Template->render(Array) (Line: 55)
twig_render_template('themes/custom/yg_aesthetic/templates/html.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('html', Array) (Line: 433)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 204)
Drupal\Core\Render\Renderer->render(Array) (Line: 162)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 157)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 174)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191)
Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 713)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)