Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have a table that has current year value in it. now that we are at the new year the script failed to load and i need to change the headers names from [Jan 14] to [Jan15] and [Feb 14] to [Feb15] and so on..
Is there any dynamic way to pass Year of today into the header of the columns?
Best,
Alec
Can you provide anymore detail? It is unclear what you are trying to accomplish, the statement Year(Today()) will return the year of today in both the script and expressions.
sure, I have a source table with columns as follow:
Jan 14
Feb 14
Mar 14
and i loaded it into QlikView last year. the table headers have been changed as we entered 2015 to be:
Jan 15
Feb 15
Mar 15
I am looking to make the headers within the script dynamic so i don't face the issue every year..
Is there a reason you cannot do a load * in your script instead of specifically naming out the fields from the source table? It may be helpful if you can post a screen shot or a sample of your load script.
As jpapador pointed out, it's easy if "LOAD *" work for you. If not, you can form the column names dynamically like this:
LET vYear = Date(today(),'YY');
LOAD
[Jan $(vYear)],
[Feb $(vYear)],
.. and so on.
-Rob
Thank you Rob! This is a right.. for some reason i dont see a button to to click and show as correct answer..
HI Alec,
Glad it worked. There is no "correct" answer button because the the original post is not set as a question. Don't know if there is any way to change that now, but in the future watch for that little check box at the top when you create new questions.
-Rob