Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
jagannalla
Partner - Specialist III
Partner - Specialist III

How to get total value based on max year for each dimension

Hi,

I've data like this

LOAD * INLINE [

    Prod, Val, Year

    A, 10, 2014

    A, 20, 2014

    B, 30, 2014

    B, 40, 2015

];

Now in st.table I'll take Prod as dimension, and I need to expression to get the values,20,40 for A,B. For A the max year is 2014 and the value is 20, for B the max year is 2015 and the value is 40.

How can I achieve this ?

Thanks,

Jagan

6 Replies
anbu1984
Master III
Master III

Expr: FirstSortedValue(Val,-(Year+Val))

jagannalla
Partner - Specialist III
Partner - Specialist III
Author

I tried this but, I want to aggregate the value. B'coz I've lot values there

anbu1984
Master III
Master III

So far Prod A, expected output is 30(10+20)?

jagannalla
Partner - Specialist III
Partner - Specialist III
Author

Exactly sorry for the mistake.

anbu1984
Master III
Master III

check this

anbu1984
Master III
Master III

Dim: Prod

Expr: SubField(Concat(Aggr(Sum(Val),Prod,Year),',',-Year),',',1)