Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
ecabanas
Creator II
Creator II

Delete "some" records

Hi,

I have an issue and I don't know how to solve. I have a table with all the item prices for all the year. I replicate for every month /item and supplier the rate as a record (see example)

2017-08-30_09h38_27.png

The problem comes when the supplier gives me a new rate or a correct one.

I'm using this script to replicate the records:

//Tarifas_QVD:

//LOAD *, 

//Date(If(ItemId = Previous(ItemId), Previous(From)-1, YearEnd(Today()))) as To_

//Resident Tarifas_pre

//Order By Proveedor_Tarifa,ItemId, From desc;

//drop table Tarifas_pre;

//

//

//T:

//LOAD From,To_ as To,ItemId,Proveedor_Tarifa,Tarifa

//, Proveedor_Tarifa&'-'&ItemId & '-' & Floor(MonthEnd(From, IterNo() - 1)) as Id_Tarifa, Floor(MonthEnd(From, IterNo() - 1)) as Month_Tarifa

//resident Tarifas_QVD

//While Floor(MonthEnd(From, IterNo() - 1)) <= To_;

and the result is the following

2017-08-30_09h42_16.png

My question is, If I want to add a record that has been replicated, how could I erase the previous records or overwrite them with the new value (5,96 in this example)

Thank's for your help

Eduard

1 Reply
effinty2112
Master
Master

Hi Eduard,

Is your field Id_Tarifa a unique record ID? If it is then load your amended record with the Id_Tarifa value before loading from the qvd. Then load from the qvd with a clause like


Where Not Exists(Id_Tarifa)


this will prevent the existing record in the qvd with the same reference as the amended record from being loaded.


good luck


Andrew