Is it possible to remove the 0 values from charts?

Wondering if anyone has a way to remove the 0 values from charts as it provides no value to my users.

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.

I’m using an aggregate model and not sure how to tackle any of these recommendations. 

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.

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.

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/t/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>

I learned something new today! Never seen this before!

The chart is rendering fine, but is still loading “0” values.

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)

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…

Apparently you may also be able to get highcharts to do the right thing if you replace the 0 values with null.

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