Ignore weekends in timeline visualization in Kibana 7.10.2

I have a time series plot on my dashboard, which also includes a mvavg(10) trend line. I want to remove the weekends from the plot and all the calculations(since there is no data available for weekends).
I tried creating a scripted field(doc['timestamp'].value.getDayOfWeek()) for the same in my index to identify if it's a weekend and use that in a filter, however, the result I get after using that is just a straight line at 0.
Could someone please suggest a way to ignore weekends ?