Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Announcing the newest addition to the Qlik Community, Qlik Gallery! Learn More
Not applicable

Is it possible to evaluate expressions in LOAD INLINE Expressions ?

Hi,

I've several big table loads in one of my QlikView. And I would like to store the date of the end of each table loading. I thought the Load Inline command was the easiest way to do it, but I don't know how to evaluate date functions : for example the now() function is not evaluated. So I only have the string now() in my table (while I'm trying to get time :)).

Is someone know how to do this or have any workaround ?

Best regard

1 Solution

Accepted Solutions
MVP
MVP

Is it possible to evaluate expressions in LOAD INLINE Expressions ?

An inline table is just a data source like any other, so you can perform manipulations on it like any other:

LOAD
date(date#("Date",'YYYY/MM/DD'),'MM/DD/YY') as "Date"
,date("Date"+1) as "The Next Day"
,month("Date") as "Month"
,now() as "Now"
INLINE [
Date
2009/01/25
2009/07/18
];

5 Replies
shumailh
Contributor III

Is it possible to evaluate expressions in LOAD INLINE Expressions ?

Hi Bertrand,

I've done the same thing using following code on edit script code and put the start and end date in the variable.


MinMaxDates:
load
minstring(LoadDate_table1) as StartDate,
maxstring(LoadDate_table1) as EndDate
resident table1
//order by LoadDate_table1ASC
;
// now get the values...
let EndDate = peek('EndDate',0) ;
let StartDate = peek('StartDate',0) ;
let EndDay= day(peek('EndDate',0)) ;
let StartDay= day(peek('StartDate',0)) ;


// then clean up...
drop table MinMaxDates ;


Regards,
Shumail Hussain

MVP
MVP

Is it possible to evaluate expressions in LOAD INLINE Expressions ?

An inline table is just a data source like any other, so you can perform manipulations on it like any other:

LOAD
date(date#("Date",'YYYY/MM/DD'),'MM/DD/YY') as "Date"
,date("Date"+1) as "The Next Day"
,month("Date") as "Month"
,now() as "Now"
INLINE [
Date
2009/01/25
2009/07/18
];

MVP & Luminary
MVP & Luminary

Is it possible to evaluate expressions in LOAD INLINE Expressions ?

The way to load a function value without data, like to record the current time, is with AUTOGENERATE. For example:

LOAD now() as LoadTime AUTOGENERATE 1;

Is that what you need?

-Rob

shumailh
Contributor III

Is it possible to evaluate expressions in LOAD INLINE Expressions ?

Sorry, I though you were looking for startdate and enddate of any field.

I also experience the same problem earlier and ended up with the below code.


for each File in filelist ('$(path)$(CurrentFileName)')
LOAD * FROM [$(path)$(CurrentFileName)] (ansi, fix, no labels, header is line, record is 2 lines);
load
'$(File)' as FileName
, FileTime( '$(File)' ) as FileTime
, FileSize( '$(File)' ) as Size
autogenerate(1)
;
next File ;


Not applicable

Is it possible to evaluate expressions in LOAD INLINE Expressions ?

Thanks all for your answers,
I think I can deal with it now 🙂

Regards