Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
siva_boggarapu
Creator II
Creator 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
YoussefBelloum
Champion
Champion

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
Creator II
Creator II
Author

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
Champion
Champion

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

siva_boggarapu
Creator II
Creator II
Author

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

YoussefBelloum
Champion
Champion

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