Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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)
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
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
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