Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
ritumishra01
Contributor III
Contributor III

Date format

how to achieve date format as 

let vcurrentyear = year(Today());

let vr = '07/01/(vcurrentyear)' ;

where we want to make vcurrentyear dynamic .

Labels (2)
12 Replies
ritumishra01
Contributor III
Contributor III
Author

What if i dont run this code :-

 

// Two variables below are to be commented after first load.
Let vstart = '2020-07-01 00:00:00.000';
Let vENd = '2021-06-30 00:00:00.000';

as it already had vstart and vend in the already existing code logic .

also i have doubt  about storing the data every cycle data is being stored like ENC_24 and for next year we have to manually go and change it to ENC_24 and same for vstart and vend can we also automate so that each cycle it stores data in different folders and then in main app we can  all data at once

STORE enc4 INTO [lib://authenticateddata/wbhi/Enc_fy24.QVD] (qvd);

HeshamKhja1
Partner - Creator II
Partner - Creator II

Hi @ritumishra01 ,

The concept of the code is that you need an initial declaration of the entity storing the dates, and then a mechanism to update the dates yearly. If you already have initial declaration, then yes you can load the old file and then store the changed data into a new file.

In summary,

  1. You need to schedule the app to run yearly (or at your preferred time interval)
  2. The app will load the old file, check the same if condition of Now() >= vend (If you know all data will change to certain date at the time of scheduled load, then maybe there is no need for the if condition).
  3. Store table into the new path. (You can store to a new file name or/and folder name)
    vYear = Year(Today());
    vYY = Right('$(vYear)', 2);
    STORE enc4 INTO [lib://authenticateddata\wbhi_$(vYear)\Enc_fy_$(vYY).qvd](qvd);​

 

ritumishra01
Contributor III
Contributor III
Author

Hey thanks for your reponse

vYY = Right('$(vYear)', 2);
STORE enc4 INTO [lib://authenticateddata\wbhi_$(vYear)>\Enc_fy_$(vYY)>.qvd](qvd);​

wbhi_$(vYear) - i am getting error here its saying path not found. and how we can include date there ??? thanks