Replacing grouping header (label) with other caption dependent on underlying row content

Options
newbie321
edited February 11, 2022 in Analytics #1
<p>Hi, </p>
<p> </p>
<p>What is the best way to tackle the following problem:</p>
<p> </p>
<p>  I have a table with two columns (A and B ) that I am grouping over column 'A'.  However I do not want to display the default grouping label and want to display a custom label based on the following logic:</p>
<p>if rows in column B have different content (entries) then display 'Multiple'  in group-header row, else display the content of the first row in column B.  </p>
<p> </p>
<p>here is an example that visually demonstarate desired effect:</p>
<p> </p>
<p>Suppose I have the following data source table</p>
<p>
</p>
<p>name   |   car model</p>
<p>
</p>
<p>Jill        |   ford</p>
<p>
</p>
<p>Jill        |   chevy</p>
<p>
</p>
<p>Scott    |  toyota</p>
<p>
</p>
<p>Scott    |  toyota</p>
<p>
</p>
<p> </p>
<p>When I group  over the name I would like to see:</p>
<p> </p>
<p>Jill       |  multiple</p>
<p>Scott   |  toyota</p>
<p> </p>
<p> </p>
<p>Can this be done through some design logic or do I have to create event listeners and use onCreate and onRender events?</p>
<p> </p>
<p>Thanks,</p>
<p> </p>
<p> </p>

Comments

  • <p>Create an aggregation with distinct count. Then in the group header have data item with an if expression based on the distinct count.</p>
  • <blockquote class="ipsBlockquote" data-author="mblock" data-cid="145047" data-time="1472057264">
    <div>
    <p>Create an aggregation with distinct count. Then in the group header have data item with an if expression based on the distinct count.</p>
    </div>
    </blockquote>
    <p> </p>
    <p>Thanks, @mblock!!</p>
    <p> </p>
    <p>This is exactly what I was looking for.  Your solution works like a charm and is very elegant!!</p>
    <p> </p>
    <p>Thanks again!</p>
  • <p>Elegant is my middle name :-)</p>