
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
how to use LEFT function in inline load
Hi,
I need to use left function to take the first 4 digits from the string in the INLINE load. This string is the output of a variable I have declared in Edit Script page.
I am writing like this
AsOfTable:
LOAD * Inline
[AsOfQuarter, Quarter, Type
$(vyerqtr), $(left($(vyerqtr),4)), 'Last'
];
But the Quarter field is not returning any thing. It is blank. Please help me how should I write the left function here. Here in my code vyerqtr is the variable I have declared in Edit Script and this is returning the current year and quarter like 2013Q2. So in the second field of my inline table Quarter, I need the year 2013 from this variable.
Please help me.
Thanks
Rajneesh


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try like this:
AsOfTable:
LOAD AsOfQuarter, left(AsOfQuarter,4) as Quarter, Type Inline [
AsOfQuarter, Type
$(vyerqtr), 'Last'
];

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Swuehi,
Thanks for your answer. But I need to load the data for last 4 quarters in this table example if current year and quarter is 2013Q2, then I need data till 2012Q3. and my variable vyerqtr is returning the current year and quarter example 2013Q2.
This is the reason I wanted to use left function in my Load script.
I think if i use your suggestion, I have to create that many variables. Is this a good way or we have any other good way to proceed.
Thanks
