Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Leverage your QlikView investment to modernize BI – see how! Join Group
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

chose values by max date according to 2 fields

hi ,

I have this example:

I am not able to create max approval column. for each agreement I need to put there approval with lastest date.

I need to do it in the script for my main table, to add this column for each agreement.

can you please help.

thanks,

Anat

5 Replies
Highlighted

Re: chose values by max date according to 2 fields

Script / UI ??

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Highlighted
Contributor III
Contributor III

Re: chose values by max date according to 2 fields

script only

Highlighted

Re: chose values by max date according to 2 fields

Not tested, But can u try this?

If(agreement = Previous(agreement), approval,'') as [max approval]

OR

Table:

Load * from table;

Final:

NoConcatenate

LOAD approval, agreement, date, If(agreement = Previous(agreement), approval,'') as [max approval] Resident Table Order By date desc;

DROP Table Table;

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Highlighted
Contributor III
Contributor III

Re: chose values by max date according to 2 fields

its still returns both projects for each agreement even though it should return only 1 for each agreement

Highlighted

Re: chose values by max date according to 2 fields

Oh, Is it? Then this should work

Table:

Load * from table;

Right Join (Table)

LOAD agreement, Max(date) as date Resident Table Group By agreement;

Left Join (Table)

Load agreement,FirstSortedValue(approval, date) as [max approval] Resident Table Group By agreement;

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)