Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

beck110979
Valued Contributor III

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

1 Solution

Accepted Solutions
MVP
MVP

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;

4 Replies
MVP
MVP

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

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

MainTab:
LOAD *,RowNo() as Rowid;
LOAD * Inline
[
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)
LOAD
Projekt,
ID,
Name,
Datum,
'0 €'
as  Value
Resident MainTab
Where Exists (MaxRowId,Rowid);



beck110979
Valued Contributor III

Re: take over the value if i have last value

Hello Sunny,

thanks a lot four your help

Beck

beck110979
Valued Contributor III

Re: take over the value if i have last value

Hello Anand,

thanks a lot for your help

Beck

Community Browser