Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
abhaysingh
Valued Contributor II

How to make Monthly Snapshot of Data from source

Hi guys,

 

I need to write one script in which i can store month on month data into QVDs like just to append only.

e.g.

In Nov 18, I am loading data once and store few records in to QVD

Say: Load * Inline

[Field1,Field2

A,10

B,20

C,30];

Now this data is for Nov18 only..

 

Now In Dec18 Some new data would come,may come with existing record in Nov18 and New Records as well..

Say: Load * Inline

[Field1,Field2

A,10

D,40

E,50];

Now my output for the month of Nov and Dec is concatenation of Nov18 Data and Dec18 Data and this loop will go on for upcoming months..

Pls. note. in source i will find only latest month data.

 

Pls. suggest how i can achieve it

Regards

Abhay

 

Tags (1)
4 Replies
MVP & Luminary
MVP & Luminary

Re: How to make Monthly Snapshot of Data from source

Something like this:

MyTable: 
LOAD Field1, Field FROM ...source_table... ;
If QvdCreateTime('C:\MyDir\MyFile.qvd') >0 Then CONCATENATE (MyTable) LOAD * FROM [C:\MyDir\MyFile.qvd] (qvd) WHERE NOT Exists(Field1); EndIf STORE MyTable INTO [C:\MyDir\MyFile.qvd] (qvd);

 


talk is cheap, supply exceeds demand
abhaysingh
Valued Contributor II

Re: How to make Monthly Snapshot of Data from source

Hi Gysbert,

 

Thanks for your reply.. In suggested script i am loosing same field key output.

let say in month i am getting 3 record and in dec i am getting 7 records than consolidated 10 records should come as output with month tagged in to it.. like 3 records for nov18 and 7 Records for Dec18 and so on.

 

Regards

Abhay 

abhaysingh
Valued Contributor II

Re: How to make Monthly Snapshot of Data from source

Any suggestion guys??

MVP & Luminary
MVP & Luminary

Re: How to make Monthly Snapshot of Data from source

I'm sorry. I don't understand what you're trying to explain. Can you give an example with data? Can you post a small Qlikview document and example excel source files that demonstrate the issue.

talk is cheap, supply exceeds demand