Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

siva_boggarapu
Contributor II

How to get 2017-11 from the file name?

Hi Team,

I have below file name. But I want to display in load statement  2017-11 from the below file name?

CARSTAR - State Farm MSO RPM - 2017-11.xlsm

Thanks,

Siva

14 Replies
sureshqv
Esteemed Contributor III

Re: How to get 2017-11 from the file name?

you want output  like this?

2017-11.xlsm

gerry_hdm
Contributor II

Re: How to get 2017-11 from the file name?

you can read the filetime  from the qvd  by the Reload

QvdCreateTime('\\C:mydocs\qlikfile.qvd') as StandFile.#stand,

sureshqv
Esteemed Contributor III

Re: How to get 2017-11 from the file name?

am not sure what you are expecting?

you can get

load *,

Keepchar(Filebasename(),'0123456789') as New

];

siva_boggarapu
Contributor II

Re: How to get 2017-11 from the file name?

Hi Chanty,

I want to display

2017-11 out from the file CARSTAR - State Farm MSO RPM - 2017-11.xlsm


thanks,

Siva

sureshqv
Esteemed Contributor III

Re: How to get 2017-11 from the file name?

try this

AA:

LOAD * ,KeepChar(A,'1234567890') as Filename;

LOAD * Inline [

A

CARSTAR - State Farm MSO RPM - 2017-11.xlsm

];

siva_boggarapu
Contributor II

Re: How to get 2017-11 from the file name?

I need like

Load *

SubField(CARSTAR - State Farm MSO RPM - 2017-11.xlsm ,) as  date


I want out like 2017-11 as filed name


Thanks,

Siva



YoussefBelloum
Esteemed Contributor

Re: How to get 2017-11 from the file name?

another option can be like this:

=Subfield(filebasename(),'RPM -',2)

siva_boggarapu
Contributor II

Re: How to get 2017-11 from the file name?

=Subfield(filebasename(),'RPM -',2)

I am getting out like 2017-11.xlmx

But I want only 2017-11

b_knuever
Contributor III

Re: How to get 2017-11 from the file name?

TextBetween(text, delimiter1, delimiter2[, n])