4 Replies Latest reply: Sep 1, 2017 3:35 AM by beck bakytbek

# take over the value if i have last value

Hi Folks,

i got question, in my issue i have the following values:

Projekt, ID, Name, Datum, Value

PR_1, 1, Test1, 15.06.2017, 20 €

PR_2, 2, Test2, 30.06.2017, 40 €

where Project= PR_2 and ID = 2 are my last Value,

my question is, how can take over on the base of last ID, all value for next ID and with Datum: 30.07.2016,

the problem with next Month,i already solved,

My expected outpu is:

Projekt, ID, Name, Datum, Value

PR_1, 1, Test1, 15.06.2017, 20 €

PR_2, 2, Test2, 30.06.2017, 40 €

PR_2, 2, Test2, 30.07.2017, 0 €

does anybody have any ideas?

Thanks a lot

Beck

• ###### Re: take over the value if i have last value

May be this

Table:

LOAD * Inline [

Projekt, ID, Name, Datum, Value

PR_1, 1, Test1, 15.06.2017, 20 €

PR_2, 2, Test2, 30.06.2017, 40 €

];

Concatenate(Table)

LOAD MaxString(Projekt) as Projekt,

Max(ID) as ID,

FirstSortedValue(Name, -ID) as Name,

Date(AddMonths(FirstSortedValue(Datum, -ID), 1)) as Datum,

'0 €' as Value

Resident Table;

• ###### Re: take over the value if i have last value

Hello Sunny,

thanks a lot four your help

Beck

• ###### Re: take over the value if i have last value

You can try this also its dynamically read your last row and add to the main table.

MainTab:
LOAD *,RowNo() as Rowid;
[
Projekt, ID, Name, Datum, Value
PR_1, 1, Test1, 15.06.2017, 20 €
PR_2, 2, Test2, 30.06.2017, 40 €
]
;

MaxRow:
LOAD Max(Rowid) as MaxRowId Resident MainTab;

Final:
Concatenate(MainTab)
Projekt,
ID,
Name,
Datum,
'0 €'
as  Value
Resident MainTab
Where Exists (MaxRowId,Rowid);

• ###### Re: take over the value if i have last value

Hello Anand,

thanks a lot for your help

Beck