Share via

ADF expression

arkiboys 9,711 Reputation points
2024-03-06T09:17:23.49+00:00

hi,

do you see why I get this error which is inside the expression of a dataset?

@concat(
	dataset().p_url_path,'MOI-'
	,formatDateTime(dataset().p_CurrentDate,'dd')
	,'-'
	,iif(
		length(formatDateTime(dataset().p_CurrentDate,'MMMM')) > 3
		, formatDateTime(dataset().p_CurrentDate,'MMmM')
		, formatDateTime(dataset().p_CurrentDate,'MMM')
	)
	,'-'
	,formatDateTime(dataset().p_CurrentDate,'yyyy')
	,'.csv'
)
Azure Data Factory
Azure Data Factory

An Azure service for ingesting, preparing, and transforming data at scale.


1 answer

Sort by: Most helpful
  1. Amira Bedhiafi 42,936 Reputation points MVP Volunteer Moderator
    2024-03-06T23:26:26.2066667+00:00

    I think that ifdataset().p_CurrentDate is not in the date format or if it's null, formatDateTime will not be able to parse it, and that could be a source of error

    Try the following :

    @concat(
        dataset().p_url_path,'MOI-'
        ,formatDateTime(dataset().p_CurrentDate,'dd')
        ,'-'
        ,iif(
            length(formatDateTime(dataset().p_CurrentDate,'MMMM')) > 3
            , formatDateTime(dataset().p_CurrentDate,'MMM')
            , formatDateTime(dataset().p_CurrentDate,'MMM')
        )
        ,'-'
        ,formatDateTime(dataset().p_CurrentDate,'yyyy')
        ,'.csv'
    )
    
    

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.