Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
kumarreddy257
Contributor

Delete current month records in incremental load

Hi,

I am doing incremental load and I want to delete current month data in that load. I have to do it where clause, but how to include that condition where clause before doing STORE command. Please give me suggestions.

Regards,

Kumar

8 Replies

Re: Delete current month records in incremental load

you need to update the condition in the main table you cannot have a where clause in the store statement

Try like this :

Incrimental_table:

LOAD *

where month<>currentmonth;

SQL

incrimental statements ;

or

create a resident table with table with the where clause and use the same in the store statement

balrajahlawat
Esteemed Contributor

Re: Delete current month records in incremental load

can we do sth like:

load

Date,

Restofdata

from YourTable where num(month(Date))<>(Not Equal to)num(Month(Today()))

kumarreddy257
Contributor

Re: Delete current month records in incremental load

Thanks for your reply. Here date is coming from column DW_load_date. So CAn you tellme how do i include this month here.

Regards,

Kumar

balrajahlawat
Esteemed Contributor

Re: Delete current month records in incremental load

replace Date with DW_load_date

balrajahlawat
Esteemed Contributor

Re: Delete current month records in incremental load

just editing it:

use this:

load

date(Date,'DD/MMM/YYYY') as Date,

Restofdata

from YourTable where num(month(Date))<>(Not Equal to)num(Month(date(Today(),'DD/MMM/YYYY')))

kumarreddy257
Contributor

Re: Delete current month records in incremental load

If my data is not today, then it will give me wrong results?

balrajahlawat
Esteemed Contributor

Re: Delete current month records in incremental load

Today only or not have for full today month??

if today only, no worry.

But if you are not having data of November, you would not be able to check whether its working or not

pljsoftware
Contributor III

Re: Delete current month records in incremental load

Hi Kumar,

if would you like to make easy your job you can use the library RobWunderlich/Qlikview-Components · GitHub that contains all you need to do better incremental load.

I you want to delete record from a table you have to use inner join with a temp table where exists some fields with value that you that to mantain.

Best Regards

Luca Jonathan Panetta

Community Browser