Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
qlik99
Contributor II
Contributor II

load a dynamic fieldname to extract date

Hello,

My objectif is to extract a refresh date from excel file 

 

the problem is that this column is dynamic (date of the refresh of the excel file) 

 

thiis is my code 

Temp_Table:
LOAD

"Last Refresh Date : 9/9/2021 2:07:25 PM"

FROM [lib://CNX]
(ooxml, embedded labels, table is tabme1);

Let vVar22 = FieldName(1 ,'Temp_Table');

 

Table2:
load *,

if ('$(vVar22)' like 'Last Refresh Date*', '$(vVar22)' ) as Last_refresh_t

 


resident Temp_Table;


Table3:
load * ,


left(subfield(Last_refresh_t,':',2),9) as Last_refresh

resident Table2;

drop table Temp_Table;
drop table Table2;

 

The problem when i will load the first table the field in red will change every date because it is the refresh date 

 

So what do you think ? what i should do to extract this date dynamicly 

 

 

Thanks 

2 Solutions

Accepted Solutions
sunny_talwar

Right now you are loading the Excel with embedded label, but instead try with no label

(ooxml, embedded labels, table is tabme1);

View solution in original post

stevejoyce
Specialist II
Specialist II

If you don't know the column name, but know the column index you can load link below.  If you only want the first row, you can add "First 1"

 

First 1
LOAD

  A as ReloadDate

FROM
[xlsx.xlsx]
(ooxml, no labels, table is Sheet1);

View solution in original post

4 Replies
sunny_talwar

Right now you are loading the Excel with embedded label, but instead try with no label

(ooxml, embedded labels, table is tabme1);

qlik99
Contributor II
Contributor II
Author

Thanks for answer ,

 

the problem when i do this it gives me the a list of all the data in the same column but me i need only this :

 

"Last Refresh Date : 9/9/2021 2:07:25 PM"  to retrieve the date (tomorrow it will be 15/9/2021 etc..

 

Regards 

stevejoyce
Specialist II
Specialist II

If you don't know the column name, but know the column index you can load link below.  If you only want the first row, you can add "First 1"

 

First 1
LOAD

  A as ReloadDate

FROM
[xlsx.xlsx]
(ooxml, no labels, table is Sheet1);

sunny_talwar

You can just do Where RecNo() = 1 to just extract the first row from the data