Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
beck_bakytbek
Master
Master

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
sunny_talwar

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;

View solution in original post

4 Replies
sunny_talwar

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;

its_anandrjs
Champion III
Champion III

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);



beck_bakytbek
Master
Master
Author

Hello Sunny,

thanks a lot four your help

Beck

beck_bakytbek
Master
Master
Author

Hello Anand,

thanks a lot for your help

Beck