Skip to main content
Announcements
Qlik Launches Open Lakehouse and advanced agentic AI experience in Qlik Answers! | LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
musketeers
Creator

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

2 Replies
swuehl
MVP

Try like this:

AsOfTable:

LOAD AsOfQuarter, left(AsOfQuarter,4) as Quarter, Type Inline [

AsOfQuarter, Type

$(vyerqtr),  'Last'

];

musketeers
Creator
Author

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

Community Browser