@yvassilyeva thanks for adding the details. I wished you mentioned in your question and your SPL could have been easier... Do read the foreach command Splunk Documentation if the interpretation of the template is not clear. It has solid examples and that is where I learnt these from. https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Foreach | foreach "Com-*"
[| eval "Sum-<<MATCHSTR>>"='Tar-<<MATCHSTR>>'+'<<FIELD>>'] Following is a run anywhere search based on sample data provided so that you can play around yourself. | makeresults
| eval data="3,3,1,2,5,7;1,1,3,2,5,3"
| makemv data delim=";"
| mvexpand data
| makemv data delim=","
| eval Com-Jun=mvindex(data,0),Com-Jul=mvindex(data,1),Com-Aug=mvindex(data,2),Tar-Jun=mvindex(data,3),Tar-Jul=mvindex(data,4),Tar-Aug=mvindex(data,5)
| table *Jun, *Jul, *Aug
| foreach "Com-*"
[| eval "Sum-<<MATCHSTR>>"='Tar-<<MATCHSTR>>'+'<<FIELD>>']
| fields Com-* Tar-* Sum-*
... View more