Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Creating a Date from Source Name

Currently combining multiple excel docs with the date in the name of the excel file   eg: 2018 Capex Projects - February Forcast.xlsx   Would like to make a column that can be used to identify th...
  • Anonymous's avatar
    Anonymous
    7 years ago

    Anonymous,

    Create the following columns in your table.

    Month = if(search("january",[Source.Name],1,0)>0,01,if(search("february",[Source.Name],1,0)>0,02,if(search("march",[Source.Name],1,0)>0,03,if(search("april",[Source.Name],1,0)>0,04,if(search("may",[Source.Name],1,0)>0,05,if(search("june",[Source.Name],1,0)>0,06,if(search("july",[Source.Name],1,0)>0,07,if(search("august",[Source.Name],1,0)>0,08,if(search("september",[Source.Name],1,0)>0,09,if(search("october",[Source.Name],1,0)>0,10,if(search("november",[Source.Name],1,0)>0,11,if(search("December",[Source.Name],1,0)>0,12))))))))))))
    Year = LEFT([Source.Name],4)
    YearMonth = [Month]&"/"&[Year]



    Regards,
    Lydia