<?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: Funnels from DQL on the new dashboards in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/Create-Funnels-in-New-Dashboards-Using-DQL-Queries/m-p/285649#M2576</link>
    <description>&lt;P&gt;Great Work&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/3364"&gt;@Julius_Loman&lt;/a&gt;&amp;nbsp;. I've only added percentage to the code:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;data 
  record(timestamp = now()-30m, session="session1", `event.provider`="myapp", `event.type`="add_to_cart"), 
  record(timestamp = now()-25m, session="session1", `event.provider`="myapp", `event.type`="place_order"), 
  record(timestamp = now()-20m, session="session1", `event.provider`="myapp", `event.type`="payment"),
  record(timestamp = now()-30m, session="session2", `event.provider`="myapp", `event.type`="add_to_cart"), 
  record(timestamp = now()-25m, session="session2", `event.provider`="myapp", `event.type`="place_order"),
  // this will not be counted in the funnel
  record(timestamp = now()-30m, session="session_without_first_event", `event.provider`="myapp", `event.type`="place_order"), 
  record(timestamp = now()-25m, session="session_without_first_event", `event.provider`="myapp", `event.type`="payment"),
  // session with incorrect order
  record(timestamp = now()-20m, session="session_with_incorrect_order", `event.provider`="myapp", `event.type`="add_to_cart"), 
  record(timestamp = now()-25m, session="session_with_incorrect_order", `event.provider`="myapp", `event.type`="place_order"), 
  record(timestamp = now()-30m, session="session_with_incorrect_order", `event.provider`="myapp", `event.type`="payment")
  
| filter startsWith(event.provider,"myapp")
| sort session, timestamp asc 

// Summarize event by session into an array, so we have steps in an array for each session
| summarize steps = collectArray(event.type), by:{ session }

// Create position of each step
| fieldsAdd 
    `add_to_cart` = arrayIndexOf(steps,"add_to_cart"),
    `place_order` = arrayIndexOf(steps,"place_order"),
    `payment` = arrayIndexOf(steps,"payment")
// Replace -1 with null so we can compare order    
| fieldsAdd     
    `add_to_cart` = if(`add_to_cart`&amp;gt;=0, `add_to_cart`, else: null),
    `place_order` = if(`place_order`&amp;gt;=0, `place_order`, else: null),
    `payment` = if(`payment`&amp;gt;=0, `payment`, else: null)

// Summarize and create a funnel array of steps
| summarize 
  total_paso_0 = toDouble(countIf(`add_to_cart`&amp;gt;=0)),
  funnel = array (
    record(step="Add to cart", count=countIf(`add_to_cart`&amp;gt;=0)),
    record(step="Place order", count=countIf(`add_to_cart`&amp;gt;=0 and `place_order`&amp;gt;`add_to_cart`)),
    record(step="Payment", count=countIf(`add_to_cart`&amp;gt;=0 and `place_order`&amp;gt;`add_to_cart` and `payment`&amp;gt;`place_order`))
  )
// // Expand events into separate records
| expand funnel
| fieldsFlatten funnel
| fieldsRemove funnel
// Calculate percentage
| fieldsAdd percentage = round((toDouble(`funnel.count`)/total_paso_0)*100, decimals: 2)
// Select, rename, and order the columns
| fields step = `funnel.step`, count = `funnel.count`, percentage&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 09 Sep 2025 23:51:45 GMT</pubDate>
    <dc:creator>DanielS</dc:creator>
    <dc:date>2025-09-09T23:51:45Z</dc:date>
    <item>
      <title>Create Funnels in New Dashboards Using DQL Queries</title>
      <link>https://community.dynatrace.com/t5/DQL/Create-Funnels-in-New-Dashboards-Using-DQL-Queries/m-p/283482#M2424</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;Are there any recommendations on how to have funnel-like visualisations from DQL source? Typically business events now, probably user sessions soon.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I'm looking for some practice close to what funnels in USQL currently are, which means:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;count only consecutive events per correlation id (e.g. session)&lt;/LI&gt;
&lt;LI&gt;visualization (probably bar chart or pie chart is now the only way)&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Bizflow app is not an option in my case for several reasons:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;It is not flexible enough (only allows to select events by event.type without any further conditions)&lt;/LI&gt;
&lt;LI&gt;It is not possible to pin the funnel on a dashboard&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;Update:&lt;BR /&gt;&lt;/STRONG&gt;The best I was able to do at the moment follows:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;data 
  record(timestamp = now()-30m, session="session1", `event.provider`="myapp", `event.type`="add_to_cart"), 
  record(timestamp = now()-25m, session="session1", `event.provider`="myapp", `event.type`="place_order"), 
  record(timestamp = now()-20m, session="session1", `event.provider`="myapp", `event.type`="payment"),
  record(timestamp = now()-30m, session="session2", `event.provider`="myapp", `event.type`="add_to_cart"), 
  record(timestamp = now()-25m, session="session2", `event.provider`="myapp", `event.type`="place_order"),
  // this will not be counted in the funnel
  record(timestamp = now()-30m, session="session_without_first_event", `event.provider`="myapp", `event.type`="place_order"), 
  record(timestamp = now()-25m, session="session_without_first_event", `event.provider`="myapp", `event.type`="payment")   
| filter startsWith(event.provider,"myapp")

// Create boolean fields if step exists in a session
| summarize {
    `add_to_cart` = countIf(event.type=="add_to_cart")&amp;gt;0,
    `place_order` = countIf(event.type=="place_order")&amp;gt;0,
    `payment` = countIf(event.type=="payment")&amp;gt;0
  }, by: { session }
// Summarize events
| summarize 
  funnel = array (
    record(step="Add to cart", count=countIf(`add_to_cart`)),
    record(step="Place order", count=countIf(`add_to_cart` and `place_order`)),
    record(step="Payment", count=countIf(`add_to_cart` and `place_order` and `payment`))
  )
// Expand events into separate records
| expand funnel
| fieldsFlatten funnel
| fieldsRemove funnel&lt;/LI-CODE&gt;
&lt;P data-unlink="true"&gt;&lt;A href="https://wkf10640.apps.dynatrace.com/ui/intent/dynatrace.notebooks/view-query#%7B%22visualization%22%3A%22table%22%2C%22visualizationSettings%22%3A%7B%22table%22%3A%7B%22columnOrder%22%3A%5B%22%5B%5C%22funnel.step%5C%22%5D%22%2C%22%5B%5C%22funnel.count%5C%22%5D%22%5D%7D%7D%2C%22dt.timeframe%22%3A%7B%22from%22%3A%22now()-7d%22%2C%22to%22%3A%22now()%22%7D%2C%22dt.query%22%3A%22data%20%5Cn%20%20record(timestamp%20%3D%20now()-30m%2C%20session%3D%5C%22session1%5C%22%2C%20%60event.provider%60%3D%5C%22myapp%5C%22%2C%20%60event.type%60%3D%5C%22add_to_cart%5C%22)%2C%20%5Cn%20%20record(timestamp%20%3D%20now()-25m%2C%20session%3D%5C%22session1%5C%22%2C%20%60event.provider%60%3D%5C%22myapp%5C%22%2C%20%60event.type%60%3D%5C%22place_order%5C%22)%2C%20%5Cn%20%20record(timestamp%20%3D%20now()-20m%2C%20session%3D%5C%22session1%5C%22%2C%20%60event.provider%60%3D%5C%22myapp%5C%22%2C%20%60event.type%60%3D%5C%22payment%5C%22)%2C%5Cn%20%20record(timestamp%20%3D%20now()-30m%2C%20session%3D%5C%22session2%5C%22%2C%20%60event.provider%60%3D%5C%22myapp%5C%22%2C%20%60event.type%60%3D%5C%22add_to_cart%5C%22)%2C%20%5Cn%20%20record(timestamp%20%3D%20now()-25m%2C%20session%3D%5C%22session2%5C%22%2C%20%60event.provider%60%3D%5C%22myapp%5C%22%2C%20%60event.type%60%3D%5C%22place_order%5C%22)%2C%5Cn%20%20%2F%2F%20this%20will%20not%20be%20counted%20in%20the%20funnel%5Cn%20%20record(timestamp%20%3D%20now()-30m%2C%20session%3D%5C%22session_without_first_event%5C%22%2C%20%60event.provider%60%3D%5C%22myapp%5C%22%2C%20%60event.type%60%3D%5C%22place_order%5C%22)%2C%20%5Cn%20%20record(timestamp%20%3D%20now()-25m%2C%20session%3D%5C%22session_without_first_event%5C%22%2C%20%60event.provider%60%3D%5C%22myapp%5C%22%2C%20%60event.type%60%3D%5C%22payment%5C%22)%20%20%20%5Cn%7C%20filter%20startsWith(event.provider%2C%5C%22myapp%5C%22)%5Cn%5Cn%2F%2F%20Create%20boolean%20fields%20if%20step%20exists%20in%20a%20session%5Cn%7C%20summarize%20%7B%5Cn%20%20%20%20%60add_to_cart%60%20%3D%20countIf(event.type%3D%3D%5C%22add_to_cart%5C%22)%3E0%2C%5Cn%20%20%20%20%60place_order%60%20%3D%20countIf(event.type%3D%3D%5C%22place_order%5C%22)%3E0%2C%5Cn%20%20%20%20%60payment%60%20%3D%20countIf(event.type%3D%3D%5C%22payment%5C%22)%3E0%5Cn%20%20%7D%2C%20by%3A%20%7B%20session%20%7D%5Cn%2F%2F%20Summarize%20events%5Cn%7C%20summarize%20%5Cn%20%20funnel%20%3D%20array%20(%5Cn%20%20%20%20record(step%3D%5C%22Add%20to%20cart%5C%22%2C%20count%3DcountIf(%60add_to_cart%60))%2C%5Cn%20%20%20%20record(step%3D%5C%22Place%20order%5C%22%2C%20count%3DcountIf(%60add_to_cart%60%20and%20%60place_order%60))%2C%5Cn%20%20%20%20record(step%3D%5C%22Payment%5C%22%2C%20count%3DcountIf(%60add_to_cart%60%20and%20%60place_order%60%20and%20%60payment%60))%5Cn%20%20)%5Cn%2F%2F%20Expand%20events%20into%20separate%20records%5Cn%7C%20expand%20funnel%5Cn%7C%20fieldsFlatten%20funnel%5Cn%7C%20fieldsRemove%20funnel%22%2C%22hideInput%22%3Afalse%2C%22sourceApplication%22%3A%22dynatrace.notebooks%22%7D" target="_self"&gt;Example&lt;/A&gt;&amp;nbsp; in the playground environment.&lt;BR /&gt;&lt;BR /&gt;If a specific order of steps is required:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;data 
  record(timestamp = now()-30m, session="session1", `event.provider`="myapp", `event.type`="add_to_cart"), 
  record(timestamp = now()-25m, session="session1", `event.provider`="myapp", `event.type`="place_order"), 
  record(timestamp = now()-20m, session="session1", `event.provider`="myapp", `event.type`="payment"),
  record(timestamp = now()-30m, session="session2", `event.provider`="myapp", `event.type`="add_to_cart"), 
  record(timestamp = now()-25m, session="session2", `event.provider`="myapp", `event.type`="place_order"),
  // this will not be counted in the funnel
  record(timestamp = now()-30m, session="session_without_first_event", `event.provider`="myapp", `event.type`="place_order"), 
  record(timestamp = now()-25m, session="session_without_first_event", `event.provider`="myapp", `event.type`="payment"),
  // session with incorrect order
  record(timestamp = now()-20m, session="session_with_incorrect_order", `event.provider`="myapp", `event.type`="add_to_cart"), 
  record(timestamp = now()-25m, session="session_with_incorrect_order", `event.provider`="myapp", `event.type`="place_order"), 
  record(timestamp = now()-30m, session="session_with_incorrect_order", `event.provider`="myapp", `event.type`="payment")
  
| filter startsWith(event.provider,"myapp")
| sort session, timestamp asc 

// Summarize event by session into an array, so we have steps in an array for each session
| summarize steps = collectArray(event.type), by:{ session }

// Create position of each step
| fieldsAdd 
    `add_to_cart` = arrayIndexOf(steps,"add_to_cart"),
    `place_order` = arrayIndexOf(steps,"place_order"),
    `payment` = arrayIndexOf(steps,"payment")
// Replace -1 with null so we can compare order    
| fieldsAdd     
    `add_to_cart` = if(`add_to_cart`&amp;gt;=0, `add_to_cart`, else: null),
    `place_order` = if(`place_order`&amp;gt;=0, `place_order`, else: null),
    `payment` = if(`payment`&amp;gt;=0, `payment`, else: null)

// Summarize and create a funnel array of steps
| summarize 
  funnel = array (
    record(step="Add to cart", count=countIf(`add_to_cart`&amp;gt;=0)),
    record(step="Place order", count=countIf(`add_to_cart`&amp;gt;=0 and `place_order`&amp;gt;`add_to_cart`)),
    record(step="Payment", count=countIf(`add_to_cart`&amp;gt;=0 and `place_order`&amp;gt;`add_to_cart` and `payment`&amp;gt;`place_order`))
  )
// // Expand events into separate records
| expand funnel
| fieldsFlatten funnel
| fieldsRemove funnel&lt;/LI-CODE&gt;
&lt;P data-unlink="true"&gt;&lt;A href="https://wkf10640.apps.dynatrace.com/ui/intent/dynatrace.notebooks/view-query#%7B%22visualization%22%3A%22table%22%2C%22visualizationSettings%22%3A%7B%22table%22%3A%7B%22columnOrder%22%3A%5B%22%5B%5C%22funnel.step%5C%22%5D%22%2C%22%5B%5C%22funnel.count%5C%22%5D%22%5D%7D%7D%2C%22dt.timeframe%22%3A%7B%22from%22%3A%22now()-7d%22%2C%22to%22%3A%22now()%22%7D%2C%22dt.query%22%3A%22data%20%5Cn%20%20record(timestamp%20%3D%20now()-30m%2C%20session%3D%5C%22session1%5C%22%2C%20%60event.provider%60%3D%5C%22myapp%5C%22%2C%20%60event.type%60%3D%5C%22add_to_cart%5C%22)%2C%20%5Cn%20%20record(timestamp%20%3D%20now()-25m%2C%20session%3D%5C%22session1%5C%22%2C%20%60event.provider%60%3D%5C%22myapp%5C%22%2C%20%60event.type%60%3D%5C%22place_order%5C%22)%2C%20%5Cn%20%20record(timestamp%20%3D%20now()-20m%2C%20session%3D%5C%22session1%5C%22%2C%20%60event.provider%60%3D%5C%22myapp%5C%22%2C%20%60event.type%60%3D%5C%22payment%5C%22)%2C%5Cn%20%20record(timestamp%20%3D%20now()-30m%2C%20session%3D%5C%22session2%5C%22%2C%20%60event.provider%60%3D%5C%22myapp%5C%22%2C%20%60event.type%60%3D%5C%22add_to_cart%5C%22)%2C%20%5Cn%20%20record(timestamp%20%3D%20now()-25m%2C%20session%3D%5C%22session2%5C%22%2C%20%60event.provider%60%3D%5C%22myapp%5C%22%2C%20%60event.type%60%3D%5C%22place_order%5C%22)%2C%5Cn%20%20%2F%2F%20this%20will%20not%20be%20counted%20in%20the%20funnel%5Cn%20%20record(timestamp%20%3D%20now()-30m%2C%20session%3D%5C%22session_without_first_event%5C%22%2C%20%60event.provider%60%3D%5C%22myapp%5C%22%2C%20%60event.type%60%3D%5C%22place_order%5C%22)%2C%20%5Cn%20%20record(timestamp%20%3D%20now()-25m%2C%20session%3D%5C%22session_without_first_event%5C%22%2C%20%60event.provider%60%3D%5C%22myapp%5C%22%2C%20%60event.type%60%3D%5C%22payment%5C%22)%2C%5Cn%20%20%2F%2F%20session%20with%20incorrect%20order%5Cn%20%20record(timestamp%20%3D%20now()-20m%2C%20session%3D%5C%22session_with_incorrect_order%5C%22%2C%20%60event.provider%60%3D%5C%22myapp%5C%22%2C%20%60event.type%60%3D%5C%22add_to_cart%5C%22)%2C%20%5Cn%20%20record(timestamp%20%3D%20now()-25m%2C%20session%3D%5C%22session_with_incorrect_order%5C%22%2C%20%60event.provider%60%3D%5C%22myapp%5C%22%2C%20%60event.type%60%3D%5C%22place_order%5C%22)%2C%20%5Cn%20%20record(timestamp%20%3D%20now()-30m%2C%20session%3D%5C%22session_with_incorrect_order%5C%22%2C%20%60event.provider%60%3D%5C%22myapp%5C%22%2C%20%60event.type%60%3D%5C%22payment%5C%22)%5Cn%20%20%5Cn%7C%20filter%20startsWith(event.provider%2C%5C%22myapp%5C%22)%5Cn%7C%20sort%20session%2C%20timestamp%20asc%20%5Cn%5Cn%2F%2F%20Summarize%20event%20by%20session%20into%20an%20array%2C%20so%20we%20have%20steps%20in%20an%20array%20for%20each%20session%5Cn%7C%20summarize%20steps%20%3D%20collectArray(event.type)%2C%20by%3A%7B%20session%20%7D%5Cn%5Cn%2F%2F%20Create%20position%20of%20each%20step%5Cn%7C%20fieldsAdd%20%5Cn%20%20%20%20%60add_to_cart%60%20%3D%20arrayIndexOf(steps%2C%5C%22add_to_cart%5C%22)%2C%5Cn%20%20%20%20%60place_order%60%20%3D%20arrayIndexOf(steps%2C%5C%22place_order%5C%22)%2C%5Cn%20%20%20%20%60payment%60%20%3D%20arrayIndexOf(steps%2C%5C%22payment%5C%22)%5Cn%2F%2F%20Replace%20-1%20with%20null%20so%20we%20can%20compare%20order%20%20%20%20%5Cn%7C%20fieldsAdd%20%20%20%20%20%5Cn%20%20%20%20%60add_to_cart%60%20%3D%20if(%60add_to_cart%60%3E%3D0%2C%20%60add_to_cart%60%2C%20else%3A%20null)%2C%5Cn%20%20%20%20%60place_order%60%20%3D%20if(%60place_order%60%3E%3D0%2C%20%60place_order%60%2C%20else%3A%20null)%2C%5Cn%20%20%20%20%60payment%60%20%3D%20if(%60payment%60%3E%3D0%2C%20%60payment%60%2C%20else%3A%20null)%5Cn%5Cn%2F%2F%20Summarize%20and%20create%20a%20funnel%20array%20of%20steps%5Cn%7C%20summarize%20%5Cn%20%20funnel%20%3D%20array%20(%5Cn%20%20%20%20record(step%3D%5C%22Add%20to%20cart%5C%22%2C%20count%3DcountIf(%60add_to_cart%60%3E%3D0))%2C%5Cn%20%20%20%20record(step%3D%5C%22Place%20order%5C%22%2C%20count%3DcountIf(%60add_to_cart%60%3E%3D0%20and%20%60place_order%60%3E%60add_to_cart%60))%2C%5Cn%20%20%20%20record(step%3D%5C%22Payment%5C%22%2C%20count%3DcountIf(%60add_to_cart%60%3E%3D0%20and%20%60place_order%60%3E%60add_to_cart%60%20and%20%60payment%60%3E%60place_order%60))%5Cn%20%20)%5Cn%2F%2F%20%2F%2F%20Expand%20events%20into%20separate%20records%5Cn%7C%20expand%20funnel%5Cn%7C%20fieldsFlatten%20funnel%5Cn%7C%20fieldsRemove%20funnel%22%2C%22hideInput%22%3Afalse%2C%22sourceApplication%22%3A%22dynatrace.notebooks%22%7D" target="_self"&gt;Example&lt;/A&gt; in the playground&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Does anyone know a better solution?&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/316"&gt;@KlausEnzenhofer&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Dec 2025 13:23:40 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Create-Funnels-in-New-Dashboards-Using-DQL-Queries/m-p/283482#M2424</guid>
      <dc:creator>Julius_Loman</dc:creator>
      <dc:date>2025-12-17T13:23:40Z</dc:date>
    </item>
    <item>
      <title>Re: Funnels from DQL on the new dashboards</title>
      <link>https://community.dynatrace.com/t5/DQL/Create-Funnels-in-New-Dashboards-Using-DQL-Queries/m-p/285649#M2576</link>
      <description>&lt;P&gt;Great Work&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/3364"&gt;@Julius_Loman&lt;/a&gt;&amp;nbsp;. I've only added percentage to the code:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;data 
  record(timestamp = now()-30m, session="session1", `event.provider`="myapp", `event.type`="add_to_cart"), 
  record(timestamp = now()-25m, session="session1", `event.provider`="myapp", `event.type`="place_order"), 
  record(timestamp = now()-20m, session="session1", `event.provider`="myapp", `event.type`="payment"),
  record(timestamp = now()-30m, session="session2", `event.provider`="myapp", `event.type`="add_to_cart"), 
  record(timestamp = now()-25m, session="session2", `event.provider`="myapp", `event.type`="place_order"),
  // this will not be counted in the funnel
  record(timestamp = now()-30m, session="session_without_first_event", `event.provider`="myapp", `event.type`="place_order"), 
  record(timestamp = now()-25m, session="session_without_first_event", `event.provider`="myapp", `event.type`="payment"),
  // session with incorrect order
  record(timestamp = now()-20m, session="session_with_incorrect_order", `event.provider`="myapp", `event.type`="add_to_cart"), 
  record(timestamp = now()-25m, session="session_with_incorrect_order", `event.provider`="myapp", `event.type`="place_order"), 
  record(timestamp = now()-30m, session="session_with_incorrect_order", `event.provider`="myapp", `event.type`="payment")
  
| filter startsWith(event.provider,"myapp")
| sort session, timestamp asc 

// Summarize event by session into an array, so we have steps in an array for each session
| summarize steps = collectArray(event.type), by:{ session }

// Create position of each step
| fieldsAdd 
    `add_to_cart` = arrayIndexOf(steps,"add_to_cart"),
    `place_order` = arrayIndexOf(steps,"place_order"),
    `payment` = arrayIndexOf(steps,"payment")
// Replace -1 with null so we can compare order    
| fieldsAdd     
    `add_to_cart` = if(`add_to_cart`&amp;gt;=0, `add_to_cart`, else: null),
    `place_order` = if(`place_order`&amp;gt;=0, `place_order`, else: null),
    `payment` = if(`payment`&amp;gt;=0, `payment`, else: null)

// Summarize and create a funnel array of steps
| summarize 
  total_paso_0 = toDouble(countIf(`add_to_cart`&amp;gt;=0)),
  funnel = array (
    record(step="Add to cart", count=countIf(`add_to_cart`&amp;gt;=0)),
    record(step="Place order", count=countIf(`add_to_cart`&amp;gt;=0 and `place_order`&amp;gt;`add_to_cart`)),
    record(step="Payment", count=countIf(`add_to_cart`&amp;gt;=0 and `place_order`&amp;gt;`add_to_cart` and `payment`&amp;gt;`place_order`))
  )
// // Expand events into separate records
| expand funnel
| fieldsFlatten funnel
| fieldsRemove funnel
// Calculate percentage
| fieldsAdd percentage = round((toDouble(`funnel.count`)/total_paso_0)*100, decimals: 2)
// Select, rename, and order the columns
| fields step = `funnel.step`, count = `funnel.count`, percentage&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Sep 2025 23:51:45 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Create-Funnels-in-New-Dashboards-Using-DQL-Queries/m-p/285649#M2576</guid>
      <dc:creator>DanielS</dc:creator>
      <dc:date>2025-09-09T23:51:45Z</dc:date>
    </item>
    <item>
      <title>Re: Funnels from DQL on the new dashboards</title>
      <link>https://community.dynatrace.com/t5/DQL/Create-Funnels-in-New-Dashboards-Using-DQL-Queries/m-p/285729#M2578</link>
      <description>&lt;P&gt;Here is my idea for more generic query where "ifs" for each step are not needed for 1st case, so order is not obligatory (repetitions are allowed):&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;data 
  record(timestamp = now()-30m, session="session0", `event.provider`="myapp", `event.type`="add_to_cart"), 
  record(timestamp = now()-30m, session="session1", `event.provider`="myapp", `event.type`="add_to_cart"), 
  record(timestamp = now()-25m, session="session1", `event.provider`="myapp", `event.type`="place_order"), 
  record(timestamp = now()-20m, session="session1", `event.provider`="myapp", `event.type`="payment"),
  record(timestamp = now()-30m, session="session2", `event.provider`="myapp", `event.type`="add_to_cart"), 
  record(timestamp = now()-25m, session="session2", `event.provider`="myapp", `event.type`="place_order"),
  // this will not be counted in the funnel
  record(timestamp = now()-30m, session="session_without_first_event", `event.provider`="myapp", `event.type`="place_order"), 
  record(timestamp = now()-25m, session="session_without_first_event", `event.provider`="myapp", `event.type`="payment")   
  
// Summarize event by session into an array, so we have steps in an array for each session
| summarize steps = collectArray(event.type), by:{ session }

| fieldsAdd stepsOrder=array(record(id="add_to_cart", name="Add to cart"), record(id="place_order", name="Place order"), record(id="payment", name="Payment"))

| fieldsAdd p = stepsOrder[][id]
| fieldsAdd p = arrayRemoveNulls(iCollectArray(if(arrayIndexOf(steps, p[])&amp;gt;-1, record(name=stepsOrder[][name], index=iIndex()))))
| filterOut iAny(p[][index]!=iIndex())
| expand p
| summarize { cnt = count() }, by: { index=p[index], name=p[name] }
| sort index asc&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Funnel definion is an array (stepsOrder) with records carrying identification of step and its name. Order in array also defines oder is steps in funnel.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Fist step is to collect step ids for each session.&lt;/P&gt;&lt;P&gt;Next step is get array of identified steps:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;if(arrayIndexOf(steps, p[])&amp;gt;-1, record(name=stepsOrder[][name], index=iIndex()))&lt;/LI-CODE&gt;&lt;P&gt;If step was present we get record with step name and its index.&lt;/P&gt;&lt;P&gt;If we eliminate nulls from the table and intermediate step was missing, index remembered will be different actual in the table. This can be used to eliminate sessions with holes&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| filterOut iAny(p[][index]!=iIndex())&lt;/LI-CODE&gt;&lt;P&gt;Last part is to expand and count steps. Because we were checking template vs. actual steps, duplicates are not counted. And finally we can just sort by step index.&lt;/P&gt;&lt;P&gt;Re visualization: IMHO most appropiate way to show funnel out of existing ones is "categorical chart". It shows data in order as provided, so funnel should be also visible&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="krzysztof_hoja_0-1757526272389.png" style="width: 800px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/30029i210BD1CD6EB1507D/image-dimensions/800x420?v=v2" width="800" height="420" role="button" title="krzysztof_hoja_0-1757526272389.png" alt="krzysztof_hoja_0-1757526272389.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note: I used string as id as in original example, but it does not have to be simple type. In more advanced cases we can construct id as a complex record in our funnel definition and in actual data. Finding such ids in array works too.&lt;/P&gt;&lt;P&gt;I will also think about case where order os steps is important.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Sep 2025 17:52:34 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Create-Funnels-in-New-Dashboards-Using-DQL-Queries/m-p/285729#M2578</guid>
      <dc:creator>krzysztof_hoja</dc:creator>
      <dc:date>2025-09-10T17:52:34Z</dc:date>
    </item>
  </channel>
</rss>

