Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

YoussefBelloum
Esteemed Contributor

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

My bad, I thought it was the file extension..

you can do a lot of things to remove xlmx, like this one

=purgechar(SubField(Filebasename() ,'RPM -',2),'.xlmx')

siva_boggarapu
Contributor II

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

Hi,

I have load script like below.

vFilename=lib://DEV - QVD Extracts/Intake_Carstar_USA/StateFarm_RPM/CARSTAR - State Farm MSO RPM - 2017-11.xlsm

Load F1,

     F2,

    subfiled($(vFilename),-) as date

I want to get date like 2017-11

How Can I get it?

YoussefBelloum
Esteemed Contributor

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

I don't know how you created the variable on the script, but I suppose that it give you this:

lib://DEV - QVD Extracts/Intake_Carstar_USA/StateFarm_RPM/CARSTAR - State Farm MSO RPM - 2017-11.xlsm

you can try this:

Load F1,

     F2,

    PurgeChar(SubField($(vFilename) ,'RPM -',2),' .xlsm') as date

Highlighted
siva_boggarapu
Contributor II

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

Its giving '-' result. I want like 2017-11

YoussefBelloum
Esteemed Contributor

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

Create a sample QVF file on which you have just your variable and your wrong output '-' and attach it.