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: 
dunnalahk123
Creator III
Creator III

How can we take snapshot data

Hi,

Can some one help me how can we take snapshot data from the QVD.

Example : i have a QVD which is having data from 2016 November 1st  to till date.

so now i want to take data from 2016 November 1st  to till  oct 1st  2018 and store it in a QVD . when creating a QVD in the a new Month field should be created and value should be stored as 201809.

same again when i took data on Nov 1st next month ,

again it should take data from 2016 November 1st  to Nov 1st 2018 and store it in a same existing QVD which we created earlier . ( Basically it should append the rows )  and month value should be 201810.

how can we do this approach, can some one help me here.

Best Regards,

HK

1 Solution

Accepted Solutions
aarkay29
Specialist
Specialist

Assuming you already have the qvd for OCT ! if not use the script above the concatenate statement and store the table into snapshot.qvd to create a snapshot qvd.


Table:

load *,

Date(Monthstart(today()).'YYYYMM') as MonthValue

From

     QVD;

Concatenate

Load *

From

     Snapshot.QVD;

Store Table into Snapshot.qvd(qvd);


View solution in original post

5 Replies
aarkay29
Specialist
Specialist

Assuming you already have the qvd for OCT ! if not use the script above the concatenate statement and store the table into snapshot.qvd to create a snapshot qvd.


Table:

load *,

Date(Monthstart(today()).'YYYYMM') as MonthValue

From

     QVD;

Concatenate

Load *

From

     Snapshot.QVD;

Store Table into Snapshot.qvd(qvd);


dunnalahk123
Creator III
Creator III
Author

Hi ,

Thank You for your reply.

Date(Monthstart(today()).'YYYYMM') as MonthValue >>> this is giving current month.


but when i ran this QVD on oct 1st it should give me month as 201809 not 201810.


we are taking the data always for completed months.


so once oct month is completed and when i ran this QVD on Nov 1st it should give me month as 201810.




Best Regards,

HK

tresesco
MVP
MVP

To go one month back, you can try like:

Date(Monthstart(today(),-1)'YYYYMM')

dunnalahk123
Creator III
Creator III
Author

Hi ,

Thank You for all your suggestions. i got the idea

Best Regards,

Hk

dunnalahk123
Creator III
Creator III
Author

Hi Kay,

I have one more Requirement

once month is completed we are taking above approach but the current month as well it should show the Results till month completes. because users want to see live data as well .

means once month is completed results should go to snapshot QVD with creating previous month number like .(201809).

and current month data  as well it should show in my piviot with 201810.

example: we are in oct now , so if i take results now for sep it should store results in snapshot QVD with 201809.

and it show the current month 201810 Results as well in the Piviot .

any suggestions. how can i do it.