Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
MVP
MVP

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
];

View solution in original post

5 Replies
Highlighted
Creator III
Creator III

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

Highlighted
MVP
MVP

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
];

View solution in original post

Highlighted
MVP & Luminary
MVP & Luminary

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

Highlighted
Creator III
Creator III

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 ;


Highlighted
Not applicable

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

Regards