<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Filter DataTable on calculated column in Developer Q&amp;A Forum</title>
    <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Filter-DataTable-on-calculated-column/m-p/222011#M489</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/32376"&gt;@lucas_hocker&lt;/a&gt; ! I would just need a couple of things clarified, before being able to answer this question for you.&lt;BR /&gt;Specifically what you mean with &lt;EM&gt;"In the subcomponent, queries etc happen to calculate the value"&lt;/EM&gt;. Does that mean that you are not aware of the actual value, that is being rendered?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 31 Aug 2023 11:27:13 GMT</pubDate>
    <dc:creator>thomas_heller</dc:creator>
    <dc:date>2023-08-31T11:27:13Z</dc:date>
    <item>
      <title>Filter DataTable on calculated column</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Filter-DataTable-on-calculated-column/m-p/221967#M488</link>
      <description>&lt;P&gt;I have a DataTable which is driven from an array of data. It's easy to filter the table based on columns where the data is static; however, I have a few fields that are complex and the Cell is just defined as a subcomponent. In the subcomponent, queries etc happen to calculate the value. What's the "right way" to enable filtering of the DataTable on these types of calculated columns?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2023-08-31_08-45-02.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/13878i27CB837DACA6D5E6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="2023-08-31_08-45-02.png" alt="2023-08-31_08-45-02.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2023 07:04:00 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Filter-DataTable-on-calculated-column/m-p/221967#M488</guid>
      <dc:creator>lucas_hocker</dc:creator>
      <dc:date>2023-08-31T07:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: Filter DataTable on calculated column</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Filter-DataTable-on-calculated-column/m-p/222011#M489</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/32376"&gt;@lucas_hocker&lt;/a&gt; ! I would just need a couple of things clarified, before being able to answer this question for you.&lt;BR /&gt;Specifically what you mean with &lt;EM&gt;"In the subcomponent, queries etc happen to calculate the value"&lt;/EM&gt;. Does that mean that you are not aware of the actual value, that is being rendered?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2023 11:27:13 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Filter-DataTable-on-calculated-column/m-p/222011#M489</guid>
      <dc:creator>thomas_heller</dc:creator>
      <dc:date>2023-08-31T11:27:13Z</dc:date>
    </item>
    <item>
      <title>Re: Filter DataTable on calculated column</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Filter-DataTable-on-calculated-column/m-p/222014#M490</link>
      <description>&lt;P&gt;Thanks Thomas. Yes, in my source data for the DataTable I don't know the value of the `status` field. The col looks like this from the DataTable perspective:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
header: "Status",
id: "status",
autoWidth: true,
cell: ({ row }) =&amp;gt; &amp;lt;StatusCell rule={row.original} /&amp;gt;,
},&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The StatusCell queries TanStack React-query, which queries Grail. For example:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const statusRes = useStatus({ rule });
if (statusRes.status == "Muted") return &amp;lt;Indicator state="disabled"&amp;gt;Muted&amp;lt;/Indicator&amp;gt;;
if (statusRes.isError) return &amp;lt;ErrorIcon /&amp;gt;;
...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2023 11:38:20 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Filter-DataTable-on-calculated-column/m-p/222014#M490</guid>
      <dc:creator>lucas_hocker</dc:creator>
      <dc:date>2023-08-31T11:38:20Z</dc:date>
    </item>
    <item>
      <title>Re: Filter DataTable on calculated column</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Filter-DataTable-on-calculated-column/m-p/222018#M491</link>
      <description>&lt;P&gt;That data flow might be a bit hard to filter in this case. Somehow the StatusCell would need to communicate it's state up to the table to be able to filter the data accordingly.&lt;BR /&gt;While this is certainly achievable with a Context that the Cells register themselves to, it's probably the better option to fetch all information in an aggregation first, and then pack that into the `DataTable`.&lt;BR /&gt;&lt;BR /&gt;If that is not at all possible, I think you could create a react context that provides a MutableRef to a Map within, which the StatusCell can consume in order to report it's values back to the component controlling the filtering logic. Let me know if you want me to sketch something like this out in an example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2023 11:51:54 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Filter-DataTable-on-calculated-column/m-p/222018#M491</guid>
      <dc:creator>thomas_heller</dc:creator>
      <dc:date>2023-08-31T11:51:54Z</dc:date>
    </item>
  </channel>
</rss>

