Hi Team
Please help me on the below ifthenelse statment.
My requirement:
If the value of date_acc is null then i need to get fisc_end_date from date_dim table based on the given below condition else map the original value from the source.
Data types of the fields used as below
DATE_ACC is datetime type.
fisc_end_date is datetime type.
calender_year is int type. But i am passing double value in where clause.
calender_month is int type. But i am passing double value in where clause.
fiscal_year is double type.
period is double type.
So i request you to please check on the where clause of the below statment i have created and help me to come out of the syntax error. please check and correct me if i am doing wrong here.
Statement as below but i am getting syntax error message
ifthenelse( GLOBAL_BASE.DATE_ACC is null, sql('GBI_DS_DWH', 'select FISC_END_DATE from GBI_DS_DWH_DEV.dbo.DATE_DIM where calender_year = GLOBAL_BASE.FISCAL_YEAR and calender_month = GLOBAL_BASE.PERIOD'), GLOBAL_BASE.ACCOUNTING_DATE);
Regrds
Raj