Discussion Board for collaboration on QlikView Scripting.
I have a problem to create some fields such as year and month from file name.
I'm using 201801 for the file name, 2018 indicates the year and 01 means the month.
Can anyone help me how to do this ?
Thanks a lot
- Kevin -
Go to Solution.
Use the FileBaseName() function:
,Right(FileBaseName(), 4) as Year
,Left(FileBaseName(),2) as Month
View solution in original post
You can use the left and right function to achieve this.
Left(201801,4) will give you 2018 i.e the Year
Right(201801,2) will give you 01 i.e the Month.
Note- To get filename in the script you can use the FileBaseName() function.
Let me know if it fulfils your requirement.
Thanks a lot for the answer