Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
olguita2014
Contributor

Qlik Sense: Store a QVD with a Variable Name

Hi Everyone


In my script I want to store the filename as every day, for example:


store * from Precio_Crudo_GasNatural_OPEP into 'lib://QVDs/Precio_Crudo_GasNatural_OPEP_$(vFecha).qvd'(qvd);

but the result is :  Precio_Crudo_GasNatural_OPEP_=Now().qvd

and I want to store like that:

Precio_Crudo_GasNatural_OPEP_27/09/2016.qvd

Precio_Crudo_GasNatural_OPEP_28/09/2016.qvd

Precio_Crudo_GasNatural_OPEP_29/09/2016.qvd

etc

I create a variable vFecha=Now()  but how do I use that as part of the filename?


Thanks.



1 Solution

Accepted Solutions
MVP & Luminary
MVP & Luminary

Re: Qlik Sense: Store a QVD with a Variable Name

Try this:

let vFecha = date(today(), 'DD.MM.YYYY'); // a slash isn't an allowed char within a filename

- Marcus

3 Replies
MVP & Luminary
MVP & Luminary

Re: Qlik Sense: Store a QVD with a Variable Name

Try this:

let vFecha = date(today(), 'DD.MM.YYYY'); // a slash isn't an allowed char within a filename

- Marcus

rohitk1609
Valued Contributor II

Re: Qlik Sense: Store a QVD with a Variable Name

Hi Olga,

Run the below script you will have your best solution:

=> create a new folder connection with name test

.

Let vtoday = date(today());

Names:

LOAD * inline [

"First name"|"Last name"|Amount|"Has cellphone"

John|Anderson|100|Yes

Sue|Brown|80|Yes

Mark|Carr|60 |No

Peter|Devonshire|40|No

Jane|Elliot|20|Yes

Peter|Franc|10|Yes ] (delimiter is '|');

store Names into "lib://test/$(vtoday).qvd"(QVD);

Please mark the appropriate replies as CORRECT / HELPFUL so our team and other members know that your question(s) has been answered to your satisfaction.

Rohit Kumar

rohitk1609
Valued Contributor II

Re: Qlik Sense: Store a QVD with a Variable Name

Hi olga,

Please replace only test with your connection name and run the script

Let vtoday = date(today());

Names:

LOAD * inline [

"First name"|"Last name"|Amount|"Has cellphone"

John|Anderson|100|Yes

Sue|Brown|80|Yes

Mark|Carr|60 |No

Peter|Devonshire|40|No

Jane|Elliot|20|Yes

Peter|Franc|10|Yes ] (delimiter is '|');

store Names into "lib://test/$(vtoday).qvd"(QVD);