Forum Discussion
Anonymous
Please check if this script works for you
widget.on('processresult', function(se, ev){
$.each(ev.result.series, function(index, value){
var prevValue = -1
$.each(value.data, function(dataindex, datavalue){
if(dataindex == 0)
prevValue = datavalue.y
else
{
if(!datavalue.y)
datavalue.y = prevValue
else
prevValue = datavalue.y
}
})
})
})
-Hari
Hi harikm007
Thank you for providing this script.
I have just tested it and it seems to work "partly". All widgets have a time filter applied for 21.02.22-27.02.22.
As you can see in the screenshot attached, I think it works as long as there is data for at least one of the two products displayed. If I only display the stock level for one product (see widget Nr. 3), then the script does not seem to work anymore. This is also indicated in widget Nr.2 where the script is applied: There are no values displayed for 26th and 27th February, as there is no value in the FACT table for both products. On 24.02. and 25.02 it correctly takes the value of 57 from 23.02.
Is there something we can change on the script to always apply this logic?
Thanks a lot!
Yannick