﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
1925	Error and enhancement in InvChEx function	César Pérez Álvarez	Víctor de Buen Remiro	"When we use InvChEx with a time series which has a 0 MaxS, it generates a non-zero expansion where we had to be a zero value.

Example:

Serie anu = -SubSer(Pulse(y2000m01d01, Anual), y2000, y2002);
Serie mon = InvChEx(anu, Monthly);

I would like to enhance this function to expand the outcome time series which all dates ""in last date"" of input time series.

This correction I think solve all problems:

Serie InvChExNew(Serie ser, TimeSet dtn)
{
  Date end  = Succ(Succ(Last(ser), Dating(ser), 1), dtn, -1);
  Date ini  = First(ser);

  Real num = MaxS(ser)+1;
  Serie ind = CalInd(C, dtn)*num;
  Expand(SubSer(InvCh(ser, ind)>>ind, ini, end),num)
};

Serie monNew = InvChExNew(anu, Monthly);

You can compare different outputs time series between mon and monNew to see it works.

Its important to explain in description that Dating(ser) and dtn in InvChEx must be harmonic between them.
"	defect	new	normal	Mantainance	Packages	3.3	major			
