Is it possible to remove the 0 values from charts?

edited June 25, 2020 in Questions
Wondering if anyone has a way to remove the 0 values from charts as it provides no value to my users.

Comments

  • Pat VachonPat Vachon 💎💎💎
    edited June 25, 2020
    Several ways.

    You can create a snippet to remove the points from the series.
    You can manually create a condition in XML where the value != 0.
    You can create a condition on the model that filters out anything where the value is 0.
  • edited July 26, 2018
    I'm using an aggregate model and not sure how to tackle any of these recommendations. 
  • Mark DeSimoneMark DeSimone 🛠️ 
    edited February 4, 2020
    Hi Joe,

    When you're building your aggregate model, are the zero values just the results of a group sum (or count) totaling 0? In other words, it would help to understand more about what the zeros look like in the model itself, to see if any of Pat's suggestions could be leveraged.
  • Pat VachonPat Vachon 💎💎💎
    edited June 25, 2020
    Can you copy the SOQL generated by the model? Alternatively, can you copy the XML for the page along with the name/id of the model being used in the chart.
  • Bill McCulloughBill McCullough 💎💎
    edited July 30, 2018
    Josef,

    I think the easiest approach is to add the 'Having' clause to the XML.  Skuid's API supports adding the 'Having' clause to the SOQL, but there is no user interface to add this XML to the page.  Here is a write up from Zach:  https://community.skuid.com/skuid/topics/filter_on_count

    Here is the XML to add.  It goes just below the 'groupby' XML.
    <havings>
        <having field="Id" fieldfunction="COUNT" operator="gt" value="0" enclosevalueinquotes="false"/>
    </havings>

    Here is a sample page that shows the count of Tasks by Owner where the Count>5.

    Thanks,

    Bill

    <skuidpage personalizationmode="server" showsidebar="true" useviewportmeta="true" showheader="true">
        <models>
            <model id="TaskCountByOwner" query="true" createrowifnonefound="false" datasource="salesforce" sobject="Task" type="aggregate">
                <fields>
                    <field id="Id" name="countId" function="COUNT"/>
                </fields>
                <conditions/>
                <actions/>
                <groupby method="simple">
                    <field id="OwnerId" name="ownerId"/>
                    <field id="Owner.Name" name="ownerName"/>
                </groupby>
                <havings>
                    <having field="Id" fieldfunction="COUNT" operator="gt" value="5" enclosevalueinquotes="false"/>
                </havings>
            </model>
        </models>
        <components>
            <skootable showconditions="true" showsavecancel="false" showerrorsinline="true" searchmethod="server" searchbox="true" showexportbuttons="false" hideheader="false" hidefooter="false" pagesize="10" alwaysresetpagination="false" createrecords="false" model="TaskCountByOwner" buttonposition="" mode="readonly" allowcolumnreordering="true" responsive="true" uniqueid="sk-3SJP-333">
                <fields>
                    <field id="Owner.Name" name="ownerName" hideable="true" uniqueid="fi-3SJR-351"/>
                    <field id="Id" name="countId" hideable="true" uniqueid="fi-3SJR-352"/>
                </fields>
                <rowactions/>
                <massactions usefirstitemasdefault="true"/>
                <views>
                    <view type="standard"/>
                </views>
            </skootable>
        </components>
        <resources>
            <labels/>
            <javascript/>
            <css/>
            <actionsequences uniqueid="sk-3SJL-315"/>
        </resources>
        <styles>
            <styleitem type="background" bgtype="none"/>
        </styles>
    </skuidpage>

  • Pat VachonPat Vachon 💎💎💎
    edited July 27, 2018
    I learned something new today! Never seen this <having> before!
  • edited July 27, 2018
    The chart is rendering fine, but is still loading "0" values. image
  • edited July 27, 2018
    Hey Mark,
     
    The zero values are a result of a group count.

    Here is the model's SOQL:

    SELECT COUNT(Id) countId,COUNT(Id) TeamAverage,OwnerId ownerId,Owner.Name ownerName,Type type FROM Task WHERE (Type in ('Call','Call Connect','Email','Email connect','Face to Face Meeting','AE Connect','Left Voice Mail'))AND(OwnerId in ('005800000091XI2AAM','0058000000CN9woAAD','0058000000EfaU1AAJ','0058000000Eg02CAAR')) GROUP BY OwnerId,Owner.Name,Type HAVING (COUNT(Id) > 0)
  • Matt SonesMatt Sones 💎💎💎
    edited July 30, 2018
    Looks like there's not really a simple answer here, but you can do this with a before render snippet using the highcharts api:

    https://stackoverflow.com/questions/49421548/want-to-hide-column-having-0-value-in-highchart-basic-c...
  • Matt SonesMatt Sones 💎💎💎
    edited July 31, 2018
    Apparently you may also be able to get highcharts to do the right thing if you replace the 0 values with null.
  • Bill McCulloughBill McCullough 💎💎
    edited July 31, 2018
    Matt,

    This is a cool find.  It means you can 'hide' the '0' values (or any 'x' value) using a formula field.  Something like this:

    IF({{countId}}>10,{{countId}},"")

    Just change you chart to use the formula field instead of 'countId'.

    Thanks!

    Bill
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!