<?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: Transpose without aggregate column in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Transpose-without-aggregate-column/m-p/518052#M34752</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/129407"&gt;@thambisetty&lt;/a&gt;&amp;nbsp;this will end up padding all rows endlessly. If you have 100 rows... 100th row will have 100 spaces padded.&lt;/P&gt;&lt;P&gt;My Solution pads space only if there is a duplicate. If the same title repeats 3 times it pads three spaces. But if there are 100 rows with 99 rows and 1 duplicate your solution will pad each column with an incremental space.&lt;/P&gt;&lt;P&gt;I replaced space " " with hyphen "-", and you can see for yourself what your query is doing vs. mine&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults count=100
| eval Title="T"
| streamstats count as sno
| eval Title=Title.sno
| eval Duration=substr(tostring(random()),1,2)
| table Title,Duration 
| streamstats count as padSpace 
| eval Title=replace(mvjoin(mvrange(1,padSpace+1,1),"-"),"\d","")."".Title 
| fields - padSpace 
| transpose 0 header_field=Title column_name=Title&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is what my query will do for same scenario:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults count=100
| eval Title="T"
| streamstats count as sno
| eval Title=Title.sno
| eval Duration=substr(tostring(random()),1,2)
| table Title Duration 
| sort Title 
| streamstats count as padSpace by Title reset_on_change=true
| eval Title=replace(mvjoin(mvrange(1,padSpace+1,1),"-"),"\d","")."".Title
| fields - padSpace
| transpose 0 header_field=Title column_name=Title&lt;/LI-CODE&gt;</description>
    <pubDate>Sat, 05 Sep 2020 18:18:11 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2020-09-05T18:18:11Z</dc:date>
    <item>
      <title>Transpose without aggregate column</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Transpose-without-aggregate-column/m-p/518033#M34741</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I want to show the elapsed time of each event return by my query .&lt;/P&gt;&lt;P&gt;The elapsed time is on field name execTime, the event name on field Title.&lt;/P&gt;&lt;P&gt;I used a bar chart stacked to show the result.&lt;/P&gt;&lt;P&gt;My query is :&amp;nbsp;&lt;/P&gt;&lt;P&gt;index=blabla |&amp;nbsp;table title, execTime | transpose 0 header_field=title include_empty=true&lt;/P&gt;&lt;P&gt;The issue is transpose command aggregate all title with the same value. I won't that.&lt;/P&gt;&lt;P&gt;Before transpose I have this :&amp;nbsp;&lt;/P&gt;&lt;TABLE border="0" width="120" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="80" height="20"&gt;&lt;FONT face="Calibri" color="#000000"&gt;Title&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="80"&gt;&lt;FONT face="Calibri" color="#000000"&gt;Duration&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;&lt;FONT face="Calibri" color="#000000"&gt;T1&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT face="Calibri" color="#000000"&gt;2&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;&lt;FONT face="Calibri" color="#000000"&gt;T2&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT face="Calibri" color="#000000"&gt;5&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;&lt;FONT face="Calibri" color="#000000"&gt;T3&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT face="Calibri" color="#000000"&gt;1&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;&lt;FONT face="Calibri" color="#000000"&gt;T2&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT face="Calibri" color="#000000"&gt;6&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;&lt;FONT face="Calibri" color="#000000"&gt;T4&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT face="Calibri" color="#000000"&gt;12&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After transpose I have this (T2 is agregate with sum) :&amp;nbsp;&lt;/P&gt;&lt;TABLE border="0" width="320" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="80" height="20"&gt;&lt;FONT face="Calibri" color="#000000"&gt;T1&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="80"&gt;&lt;FONT face="Calibri" color="#000000"&gt;T3&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="80"&gt;&lt;FONT face="Calibri" color="#000000"&gt;T2&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="80"&gt;&lt;FONT face="Calibri" color="#000000"&gt;T4&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;&lt;FONT face="Calibri" color="#000000"&gt;2&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT face="Calibri" color="#000000"&gt;1&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT face="Calibri" color="#000000"&gt;11&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT face="Calibri" color="#000000"&gt;12&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I want this :&amp;nbsp;&lt;/P&gt;&lt;TABLE border="0" width="400" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="79.8" height="15"&gt;&lt;FONT face="Calibri" color="#000000"&gt;T1&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="79.8" height="15"&gt;&lt;FONT face="Calibri" color="#000000"&gt;T2&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="79.8" height="15"&gt;&lt;FONT face="Calibri" color="#000000"&gt;T3&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="79.8" height="15"&gt;&lt;FONT face="Calibri" color="#000000"&gt;T2&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="79.8" height="15"&gt;&lt;FONT face="Calibri" color="#000000"&gt;T4&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="79.8" height="15"&gt;&lt;FONT face="Calibri" color="#000000"&gt;2&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="79.8" height="15"&gt;&lt;FONT face="Calibri" color="#000000"&gt;5&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="79.8" height="15"&gt;&lt;FONT face="Calibri" color="#000000"&gt;1&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="79.8" height="15"&gt;&lt;FONT face="Calibri" color="#000000"&gt;6&lt;/FONT&gt;&lt;/TD&gt;&lt;TD width="79.8" height="15"&gt;&lt;FONT face="Calibri" color="#000000"&gt;12&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Sat, 05 Sep 2020 14:56:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Transpose-without-aggregate-column/m-p/518033#M34741</guid>
      <dc:creator>matimat</dc:creator>
      <dc:date>2020-09-05T14:56:03Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose without aggregate column</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Transpose-without-aggregate-column/m-p/518040#M34744</link>
      <description>&lt;P&gt;&lt;STRONG&gt;[UPDATED ANSWER]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/214241"&gt;@matimat&lt;/a&gt;&amp;nbsp;Since you do not need to change the order of sorting of results. You may have use different streamstats. Try the following which will not require sorting (I have included by clause in streamstats to detect a change in Title):&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=blabla
| tableTitle,Duration
| streamstats count as padSpace by Title
| eval Title=replace(mvjoin(mvrange(1,padSpace+1,1)," "),"\d","")."".Title
| fields Title Duration
| transpose 0 header_field=title include_empty=true&lt;/LI-CODE&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Without Sorting&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| fields - _time 
| eval data="T1,2;T2,5;T3,1;T2,6;T4,12" 
| makemv data delim=";" 
| mvexpand data 
| makemv data delim="," 
| eval Title=mvindex(data,0),Duration=mvindex(data,1) 
| fields - _data 
| table Title Duration 
| streamstats count as padSpace by Title
| eval Title=replace(mvjoin(mvrange(1,padSpace+1,1)," "),"\d","")."".Title
| fields Title Duration
| transpose 0 header_field=Title column_name=Title&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;____________________________________________________________&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;With Sorting&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;The above search sorts title and count of repetition of the same title using streamstats.&lt;BR /&gt;The eval prefixes space character for each repetition of Title so that although Table Title look the same they are actually prefixed with one of more spaces depending on repetition.&lt;/P&gt;&lt;P&gt;Please try out and confirm. Following is a run anywhere example as per the data/field in your question:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| fields - _time 
| eval data="T1,2;T2,5;T3,1;T2,6;T4,12" 
| makemv data delim=";" 
| mvexpand data 
| makemv data delim="," 
| eval Title=mvindex(data,0),Duration=mvindex(data,1) 
| fields - _data 
| table Title Duration 
| sort Title 
| streamstats count as padSpace by Title reset_on_change=true
| eval Title=replace(mvjoin(mvrange(1,padSpace+1,1)," "),"\d","")."".Title
| fields - padSpace
| transpose 0 header_field=Title column_name=Title&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Sep 2020 03:34:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Transpose-without-aggregate-column/m-p/518040#M34744</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-09-06T03:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose without aggregate column</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Transpose-without-aggregate-column/m-p/518049#M34749</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/201110"&gt;@niketn&lt;/a&gt;&amp;nbsp; may be you can remove sort to give expected result.&lt;/P&gt;</description>
      <pubDate>Sat, 05 Sep 2020 18:04:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Transpose-without-aggregate-column/m-p/518049#M34749</guid>
      <dc:creator>thambisetty</dc:creator>
      <dc:date>2020-09-05T18:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose without aggregate column</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Transpose-without-aggregate-column/m-p/518050#M34750</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/129407"&gt;@thambisetty&lt;/a&gt;&amp;nbsp;streamstats works in streaming manner, it requires sorting to be in place for reset_on_change to work.&lt;/P&gt;</description>
      <pubDate>Sat, 05 Sep 2020 18:06:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Transpose-without-aggregate-column/m-p/518050#M34750</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-09-05T18:06:07Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose without aggregate column</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Transpose-without-aggregate-column/m-p/518051#M34751</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/201110"&gt;@niketn&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;even by clause is not required. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;| makeresults | eval _raw="Title,Duration&lt;BR /&gt;T1,2&lt;BR /&gt;T2,5&lt;BR /&gt;T3,1&lt;BR /&gt;T2,6&lt;BR /&gt;T4,12"&lt;BR /&gt;| multikv forceheader=1&lt;BR /&gt;| table Title,Duration&lt;/P&gt;&lt;P&gt;| streamstats count as padSpace&lt;BR /&gt;| eval Title=replace(mvjoin(mvrange(1,padSpace+1,1)," "),"\d","")."".Title&lt;BR /&gt;| fields - padSpace&lt;BR /&gt;| transpose 0 header_field=Title column_name=Title&lt;/P&gt;</description>
      <pubDate>Sat, 05 Sep 2020 18:08:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Transpose-without-aggregate-column/m-p/518051#M34751</guid>
      <dc:creator>thambisetty</dc:creator>
      <dc:date>2020-09-05T18:08:05Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose without aggregate column</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Transpose-without-aggregate-column/m-p/518052#M34752</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/129407"&gt;@thambisetty&lt;/a&gt;&amp;nbsp;this will end up padding all rows endlessly. If you have 100 rows... 100th row will have 100 spaces padded.&lt;/P&gt;&lt;P&gt;My Solution pads space only if there is a duplicate. If the same title repeats 3 times it pads three spaces. But if there are 100 rows with 99 rows and 1 duplicate your solution will pad each column with an incremental space.&lt;/P&gt;&lt;P&gt;I replaced space " " with hyphen "-", and you can see for yourself what your query is doing vs. mine&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults count=100
| eval Title="T"
| streamstats count as sno
| eval Title=Title.sno
| eval Duration=substr(tostring(random()),1,2)
| table Title,Duration 
| streamstats count as padSpace 
| eval Title=replace(mvjoin(mvrange(1,padSpace+1,1),"-"),"\d","")."".Title 
| fields - padSpace 
| transpose 0 header_field=Title column_name=Title&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is what my query will do for same scenario:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults count=100
| eval Title="T"
| streamstats count as sno
| eval Title=Title.sno
| eval Duration=substr(tostring(random()),1,2)
| table Title Duration 
| sort Title 
| streamstats count as padSpace by Title reset_on_change=true
| eval Title=replace(mvjoin(mvrange(1,padSpace+1,1),"-"),"\d","")."".Title
| fields - padSpace
| transpose 0 header_field=Title column_name=Title&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 05 Sep 2020 18:18:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Transpose-without-aggregate-column/m-p/518052#M34752</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-09-05T18:18:11Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose without aggregate column</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Transpose-without-aggregate-column/m-p/518053#M34753</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/129407"&gt;@thambisetty&lt;/a&gt;&amp;nbsp;this will end up padding all rows endlessly. If you have 100 rows... 100th row will have 100 spaces padded.&lt;/P&gt;&lt;P&gt;My Solution pads space only if there is a duplicate. If the same title repeats 3 times it pads three spaces. But if there are 100 rows with 99 rows and 1 duplicate your solution will pad each column with an incremental space.&lt;/P&gt;&lt;P&gt;I replaced space " " with hyphen "-", and you can see for yourself what your query is doing vs. mine&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults count=100
| eval Title="T"
| streamstats count as sno
| eval Title=Title.sno
| eval Duration=substr(tostring(random()),1,2)
| table Title,Duration 
| streamstats count as padSpace 
| eval Title=replace(mvjoin(mvrange(1,padSpace+1,1),"-"),"\d","")."".Title 
| fields - padSpace 
| transpose 0 header_field=Title column_name=Title&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 05 Sep 2020 18:15:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Transpose-without-aggregate-column/m-p/518053#M34753</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-09-05T18:15:57Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose without aggregate column</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Transpose-without-aggregate-column/m-p/518056#M34756</link>
      <description>&lt;P&gt;Thank you for your response, if I understand,&amp;nbsp; the solution is to change name identical with space.&lt;/P&gt;&lt;P&gt;My column must not be sort. For now only the solution of Karma match with my wish.&lt;/P&gt;</description>
      <pubDate>Sat, 05 Sep 2020 22:02:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Transpose-without-aggregate-column/m-p/518056#M34756</guid>
      <dc:creator>matimat</dc:creator>
      <dc:date>2020-09-05T22:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose without aggregate column</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Transpose-without-aggregate-column/m-p/518068#M34758</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/214241"&gt;@matimat&lt;/a&gt;&amp;nbsp;Try the updated answer without Sort if it fits your needs!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Sep 2020 03:35:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Transpose-without-aggregate-column/m-p/518068#M34758</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-09-06T03:35:24Z</dc:date>
    </item>
  </channel>
</rss>

