RSUM question

I'm using RSUM to tally up daily ticket sales.

But where there is a blank cell in the data table (because there were no sales that day) it leaves a blank datapoint on the chart as below.  Anyone got a fix for this?

  • Hi Simon,

    Here's the latest and greatest widget-level script for that...

    widget.on('processresult', function(se, ev){
    $.each(ev.result.series, function(seriesIndex, seriesValue){
    var prevValue = seriesValue.data[0].y;
    $.each(seriesValue.data, function(index, value){
    if(value.y == null)
    value.y = prevValue;
    else
    prevValue = value.y;
    });
    });
    });

    widget.on('render', function(sender,se){
    for (var i = 0; i < sender.queryResult.series.length; i++ ) {
    for (var j = 0; j < sender.queryResult.series[i].data.length; j++) {
    sender.queryResult.series[i].data[j].marker.enabled = false;
    }
    }
    });

    And here's how to apply it to the widget...

    (+) Analytics Scripts not Saving - Wiki - analytic Coffee! - Tessitura Community

  • Thank you! My Area chart with dates with no sales looks much better now.

    Before:


    After:

  • Chris and all,

    I've used the script to prevent these breaks, but I am coming up against an issue where there is a trail for a line where sales haven't ended yet.  I have this graph using Order Weeks from Closing, where the Black line is the current season which hasn't closed.  I am looking at Paid/Reserved with the formula being (RSUM([Total Ticket Paid/Reserved Value]),[Production Season ID1]) with the Prod Season filtered to equal the one prod season I am looking at.  

    If I remove the script, the line stops at the right order week, but with the script, you see the flat trail.  Would love to get rid of that if possible.

  • Hi Jeffrey,

    Great catch. The formula doesn't differentiate between a future week that can't yet have sales and a past week that didn't have any sales. We can probably figure out how to get the curve to stop at the final/last value, but that is susceptible to being a past value and will fail to reflect that there have been no sales between that past moment in time and today.

    So, this may continue to be a better solution for your needs, where the drawback is that the script will taper the line over the missing series (making it possible to interpret as a regular increase over the series that have no values) rather than repeating the previous non-null value over the series gaps that have no values.

    widget.on("beforeviewloaded",function(scope, args){
    args.options.plotOptions.series.connectNulls = true;
    });

    widget.on('render', function(sender,se){
    for (var i = 0; i < sender.queryResult.series.length; i++ ) {
    for (var j = 0; j < sender.queryResult.series[i].data.length; j++) {
    sender.queryResult.series[i].data[j].marker.enabled = false;
    }
    }
    }
    )
  • This is perfect.  For our needs I think the drawback is worth it.  We only see a gap in the very early weeks as this graph is looking at single ticket sales and we see some gaps during the first weeks of sales where it is subs only, but always have some scenario where a single ticket may be sold for some reason.  In those cases the taper would be relatively small.  Thanks so much!