Good to see that your response I have converted now this comment to answer Could you please check and "Accept " the answer.
I understand looks like the error is due to the nested split functions within the concat function.
I suggest few step-by-step method using variables in your pipeline:
Create a variable to store the file name without the extension:
@split(item().name, '.')[0]
Create another variable to store the part after the underscore:
@split(variables('fileNameWithoutExtension'), '_')[1]
Extract the year from the second variable:
@split(variables('partAfterUnderscore'), '-')[0]
Extract the month from the second variable:
@split(variables('partAfterUnderscore'), '-')[1]
Concatenate the final folder structure:
@concat(split(item().name, '_')[0], '/', variables('year'), '/', variables('month'))
This method uses transformations to break a complex expression into manageable It should help you avoid the nested partitioning problems you face.
If you still encounter issues, you might want to consider breaking down the expression into multiple steps using variables in your pipeline. This can help manage the complexity and make debugging easier.
I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this!
Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to "Accept " the answer. Issue: Trying to fix nested split issue in Azure data factory Pipeline expression builder
Solution: found a solution using substring, it resolved the problem.
Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.
If you have any other questions or are still running into more issues, let me know in the "comments" and I would be happy to help you.