<?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: Extraction of Fields from an Array and Creation of Columns While Maintaining the Structure, Replacing Missing Fields with Nul in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/Extraction-of-Fields-from-an-Array-and-Creation-of-Columns-While/m-p/270002#M1705</link>
    <description>&lt;P&gt;What I had in mind was adjusting original content to format conforming with KVP.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Like in this example I append "Name: " in case ':' is missing&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;data json:"""[{"a": ["Radicado: 13-02-20250213004567 ", 
 "Expediente Cliente: 9876543210 ", 
 "Johnathan Smith ", 
 "Zona Motor: NA ", 
 "Zona: Zona New York ", 
 "Agencia que radicó: Manhattan ", 
 "Usuario que radicó: jdoe ", 
 "Agencia origen cliente: Manhattan ", 
 "Asesor cliente: jdoe ", 
 "Radicado Visual: 1456789 ", 
 "Modalidad de crédito: Personal ", 
 "Línea de crédito: 410 - Personal Loan/International Clients ", 
 "Monto: $75,000.00 "]
 }]"""
| fieldsAdd a = if(contains(a[],":"), a[], else: concat("Name: ", a[]))
| fieldsAdd a = toString(a)
| parse a, "'[' KVP{ '\"' LD:key ':' LD:value '\"' ', '? }:a ']'"
| fieldsFlatten a 
| fieldsKeep "a.*"&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="krzysztof_hoja_0-1739446459484.png" style="width: 716px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/26404i499F53D5BD96B0C3/image-dimensions/716x201?v=v2" width="716" height="201" role="button" title="krzysztof_hoja_0-1739446459484.png" alt="krzysztof_hoja_0-1739446459484.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 13 Feb 2025 11:34:41 GMT</pubDate>
    <dc:creator>krzysztof_hoja</dc:creator>
    <dc:date>2025-02-13T11:34:41Z</dc:date>
    <item>
      <title>Extraction of Fields from an Array and Creation of Columns While Maintaining the Structure, Replacing Missing Fields with Nul</title>
      <link>https://community.dynatrace.com/t5/DQL/Extraction-of-Fields-from-an-Array-and-Creation-of-Columns-While/m-p/269356#M1685</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Good afternoon, I need your help. The objective is the following process with different arrays from Bizevent:&lt;/P&gt;&lt;P&gt;1. Verify in each position if the field exists&lt;BR /&gt;2. If it exists, create the column with the information from that position&lt;BR /&gt;3. If it doesn't exist, create the column but assign it "null"&lt;/P&gt;&lt;P&gt;I've tried it this way:&lt;/P&gt;&lt;P&gt;data record(a = array("estado:bueno","aplica:si","salud:buena","animal:perro")),&lt;BR /&gt;record(a=array("estado:bueno","aplica:si","salud:buena","animal:perro","lugar:francia")),&lt;BR /&gt;record(a=array("estado:bueno","aplica:si"))&lt;BR /&gt;| fieldsAdd if(iAny(a[] == "animal:perro"),"kk")&lt;BR /&gt;&lt;BR /&gt;I have tried to interact with the if statement so that if the condition is met, it takes the value from the position and creates the column. It would be something like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="carlos_carreno_0-1738782368859.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/26231i7F4DE6EDF980069E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="carlos_carreno_0-1738782368859.png" alt="carlos_carreno_0-1738782368859.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Feb 2025 19:09:04 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Extraction-of-Fields-from-an-Array-and-Creation-of-Columns-While/m-p/269356#M1685</guid>
      <dc:creator>carlos_carreno</dc:creator>
      <dc:date>2025-02-05T19:09:04Z</dc:date>
    </item>
    <item>
      <title>Re: Extraction of Fields from an Array and Creation of Columns While Maintaining the Structure, Replacing Missing Fields with Nul</title>
      <link>https://community.dynatrace.com/t5/DQL/Extraction-of-Fields-from-an-Array-and-Creation-of-Columns-While/m-p/269974#M1701</link>
      <description>&lt;P&gt;It looks like you are looking for "transpose" function which is not available. Currently the only way to achieve it is via workaround using DPL parsing.&lt;BR /&gt;&lt;BR /&gt;To achieve view like your screenshot:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;data record(a = array("estado:bueno","aplica:si","salud:buena","animal:perro")),
record(a=array("estado:bueno","aplica:si","salud:buena","animal:perro","lugar:francia")),
record(a=array("estado:bueno","aplica:si"))
| fieldsAdd a = toString(a)
| parse a, "'[' KVP{ '\"' LD:key ':' LD:value '\"' ', '? }:a ']'"
| fieldsFlatten a 
| fieldsKeep "a.*"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Result look like:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="krzysztof_hoja_0-1739434341374.png" style="width: 827px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/26396i3A207FCEB4CD95D3/image-dimensions/827x362?v=v2" width="827" height="362" role="button" title="krzysztof_hoja_0-1739434341374.png" alt="krzysztof_hoja_0-1739434341374.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2025 08:14:33 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Extraction-of-Fields-from-an-Array-and-Creation-of-Columns-While/m-p/269974#M1701</guid>
      <dc:creator>krzysztof_hoja</dc:creator>
      <dc:date>2025-02-13T08:14:33Z</dc:date>
    </item>
    <item>
      <title>Re: Extraction of Fields from an Array and Creation of Columns While Maintaining the Structure, Replacing Missing Fields with Nul</title>
      <link>https://community.dynatrace.com/t5/DQL/Extraction-of-Fields-from-an-Array-and-Creation-of-Columns-While/m-p/269990#M1702</link>
      <description>&lt;P&gt;What recommendation would you give when, in the field, I find that there is a data object that does not meet the key-value structure?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;["Radicado: 13-02-20250213004567 ", 
 "Expediente Cliente: 9876543210 ", 
 "Johnathan Smith ", 
 "Zona Motor: NA ", 
 "Zona: Zona New York ", 
 "Agencia que radicó: Manhattan ", 
 "Usuario que radicó: jdoe ", 
 "Agencia origen cliente: Manhattan ", 
 "Asesor cliente: jdoe ", 
 "Radicado Visual: 1456789 ", 
 "Modalidad de crédito: Personal ", 
 "Línea de crédito: 410 - Personal Loan/International Clients ", 
 "Monto: $75,000.00 "]&lt;/LI-CODE&gt;&lt;P&gt;As can be seen in the name, it does not meet the key-value condition.&lt;BR /&gt;&lt;BR /&gt;thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2025 10:39:08 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Extraction-of-Fields-from-an-Array-and-Creation-of-Columns-While/m-p/269990#M1702</guid>
      <dc:creator>carlos_carreno</dc:creator>
      <dc:date>2025-02-13T10:39:08Z</dc:date>
    </item>
    <item>
      <title>Re: Extraction of Fields from an Array and Creation of Columns While Maintaining the Structure, Replacing Missing Fields with Nul</title>
      <link>https://community.dynatrace.com/t5/DQL/Extraction-of-Fields-from-an-Array-and-Creation-of-Columns-While/m-p/269992#M1703</link>
      <description>&lt;P&gt;Do you have in mind&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; "Johnathan Smith ", &lt;/LI-CODE&gt;&lt;P&gt;element?&lt;/P&gt;&lt;P&gt;How many such cases can you have in array?&lt;/P&gt;&lt;P&gt;How do you distinguish them from each other? Index?&lt;/P&gt;&lt;P&gt;And what would you like to see as a filed name / header in the table in such case?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2025 10:50:37 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Extraction-of-Fields-from-an-Array-and-Creation-of-Columns-While/m-p/269992#M1703</guid>
      <dc:creator>krzysztof_hoja</dc:creator>
      <dc:date>2025-02-13T10:50:37Z</dc:date>
    </item>
    <item>
      <title>Re: Extraction of Fields from an Array and Creation of Columns While Maintaining the Structure, Replacing Missing Fields with Nul</title>
      <link>https://community.dynatrace.com/t5/DQL/Extraction-of-Fields-from-an-Array-and-Creation-of-Columns-While/m-p/269999#M1704</link>
      <description>&lt;P&gt;How many of those cases can you have in the array?&lt;BR /&gt;Analyzing the data, they all come in that form.&lt;/P&gt;&lt;P&gt;How do you distinguish them from each other? Index?&lt;BR /&gt;I know they are names because I know the data, but the key should be the name.&lt;/P&gt;&lt;P&gt;And what would you like to see as a field name/header in the table in such case?&lt;BR /&gt;Name.&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2025 11:24:44 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Extraction-of-Fields-from-an-Array-and-Creation-of-Columns-While/m-p/269999#M1704</guid>
      <dc:creator>carlos_carreno</dc:creator>
      <dc:date>2025-02-13T11:24:44Z</dc:date>
    </item>
    <item>
      <title>Re: Extraction of Fields from an Array and Creation of Columns While Maintaining the Structure, Replacing Missing Fields with Nul</title>
      <link>https://community.dynatrace.com/t5/DQL/Extraction-of-Fields-from-an-Array-and-Creation-of-Columns-While/m-p/270002#M1705</link>
      <description>&lt;P&gt;What I had in mind was adjusting original content to format conforming with KVP.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Like in this example I append "Name: " in case ':' is missing&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;data json:"""[{"a": ["Radicado: 13-02-20250213004567 ", 
 "Expediente Cliente: 9876543210 ", 
 "Johnathan Smith ", 
 "Zona Motor: NA ", 
 "Zona: Zona New York ", 
 "Agencia que radicó: Manhattan ", 
 "Usuario que radicó: jdoe ", 
 "Agencia origen cliente: Manhattan ", 
 "Asesor cliente: jdoe ", 
 "Radicado Visual: 1456789 ", 
 "Modalidad de crédito: Personal ", 
 "Línea de crédito: 410 - Personal Loan/International Clients ", 
 "Monto: $75,000.00 "]
 }]"""
| fieldsAdd a = if(contains(a[],":"), a[], else: concat("Name: ", a[]))
| fieldsAdd a = toString(a)
| parse a, "'[' KVP{ '\"' LD:key ':' LD:value '\"' ', '? }:a ']'"
| fieldsFlatten a 
| fieldsKeep "a.*"&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="krzysztof_hoja_0-1739446459484.png" style="width: 716px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/26404i499F53D5BD96B0C3/image-dimensions/716x201?v=v2" width="716" height="201" role="button" title="krzysztof_hoja_0-1739446459484.png" alt="krzysztof_hoja_0-1739446459484.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2025 11:34:41 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Extraction-of-Fields-from-an-Array-and-Creation-of-Columns-While/m-p/270002#M1705</guid>
      <dc:creator>krzysztof_hoja</dc:creator>
      <dc:date>2025-02-13T11:34:41Z</dc:date>
    </item>
    <item>
      <title>Re: Extraction of Fields from an Array and Creation of Columns While Maintaining the Structure, Replacing Missing Fields with Nul</title>
      <link>https://community.dynatrace.com/t5/DQL/Extraction-of-Fields-from-an-Array-and-Creation-of-Columns-While/m-p/270003#M1706</link>
      <description>&lt;P&gt;Thank you very much, you made it seem easy.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2025 11:42:41 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Extraction-of-Fields-from-an-Array-and-Creation-of-Columns-While/m-p/270003#M1706</guid>
      <dc:creator>carlos_carreno</dc:creator>
      <dc:date>2025-02-13T11:42:41Z</dc:date>
    </item>
  </channel>
</rss>

