Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to get the Date from the Table Name

Hi,

i really need help, i am trying to load data which is the Table name contains the date, since im already done with the loading, my problem is. i need to get the date from the table name itself.

Table Name is like this:

HDMF_20120210

HDMF_20120431

HDMF_20110521

I want to generate the date from Table name and connect it to my Master Calendar.

Please HELP ME...

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Use this which will give you another column with the date field

 

LOAD

[Pag-ibig No.],
[Last Name],
[First Name],
Initial,
[Employee Contribution],
[Employer Contribution],
Birthday,
MakeDate(mid(FileName(),6,4), mid(FileName(),10,2), mid(FileName(),12,2)) as DATE

FROM


(
txt, codepage is 1252, embedded labels, delimiter is '\t', msq

);

View solution in original post

8 Replies
Not applicable
Author

Hi,

You can use the Function Filename() while loading your table.

SAMPLE:

LOAD

Data,

FileName() as RAW_Tablename,

MakeDate(mid(FileName(),6,4), mid(FileName(),10,2), mid(FileName(),12,2)) as DATE

FROM

C:\Users\alexis.tan\Desktop\HDMF_20120210.xlsx

(ooxml, embedded labels, table is Sheet1);

Something like this.

Regards,

Alex

Anonymous
Not applicable
Author

Use this which will give you another column with the date field

 

LOAD

[Pag-ibig No.],
[Last Name],
[First Name],
Initial,
[Employee Contribution],
[Employer Contribution],
Birthday,
MakeDate(mid(FileName(),6,4), mid(FileName(),10,2), mid(FileName(),12,2)) as DATE

FROM


(
txt, codepage is 1252, embedded labels, delimiter is '\t', msq

);

Not applicable
Author

Hi Alex,

thank you so much! I got the answer already. thanks for your help.

Not applicable
Author

wow I gave the correct answer first but only helpful? nice

anyway, no problem, glad to have helped

Not applicable
Author

Anyway Alex,

just curious, why does the answer you gave me has 3 parameters? thanks

Not applicable
Author

did i? i maybe just an accident..

Not applicable
Author

i marked your answer as a correct answer. hehe, well anyway, let me umark the helpful answer.haha!

Not applicable
Author

I looked after seeing this in my inbox to tell you that you dont have to since I don't really care if you tag me as correct answer or not (I even said im glad to have helped). But unmarking me EVEN just as helpful o.o" THANK YOU? no points for me after I gave the answer I guess.

sanuela_jro wrote:

i marked your answer as a correct answer. hehe, well anyway, let me umark the helpful answer.haha!

GoodLuck