Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Only current month records update

Hello Everybody

In a daily load I want to update records only in current month records and it should not update previous month records. Here we don't have any date column and  we have only key column is there.

we can do update without date column also. But I need current month records only should be affected in load.

Please give me any ideas.

Regards,

Reddy

Labels (1)
6 Replies
sunny_talwar

If you don't have date, how would you even know if a particular row is for this month or last month?

Anonymous
Not applicable
Author

I mean date column in the sense, I have like mm-yyyy column is there. Not like dd/mm/yyyy.

sunny_talwar

Oh okay, then you should be able to do something like this:

Step 1) Load the new data for just the current month using the date field you have.

Step 2) Load your complete data, but use a where not exist statement to remove all the ids which are present in your new incremental data. (so remove the last one month worth of ids)

Step 3) Concatenate the new incremental data (Table in Step 1) to your existing data (Table in Step 2)

Anonymous
Not applicable
Author

Hi Sunny,

Thanks for your reply.

If you don't mind, can you give me outline code.

Regards,

Kumar

sunny_talwar

Try something like this:

NewData:

LOAD A,

          B,

          C,

          Date,

          ID as ID_Check

FROM Source

Where Num(Date) >= Num(MonthStart(Today()));

Data:

LOAD A,

          B,

          C,

          Date,

          ID

FROM someqvd.qvd (qvd)

Where not Exists(ID_Check, ID);

Concatenate(NewData)

LOAD A,

          B,

          C,

          Date,

          ID_Check as ID

Resident Data;

DROP Table NewData;