Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

sum(Amount) with lastest version of every Key

Hi Guys,

can you tell me, how can I use sum(Amount) by KeyNr, within the last version of it in backend?

I want for example sum(amount) all KeyNr from periode january to july ..

like:

sum(amount)->within only max(version)

10 Replies
hrlinder
Honored Contributor

Re: sum(Amount) with lastest version of every Key

try set Analysis

sum({<version={'$(=max(version)'}>}amount

Not applicable

Re: sum(Amount) with lastest version of every Key

it didnt work

sum({<VersH={'$(=max(VersH)'}>}LineAmountA)

edit:

money(sum({<VersH={$(=max(VersH))}>}LineAmountA))

works now without '..'

hrlinder
Honored Contributor

Re: sum(Amount) with lastest version of every Key

can you post how your Detail data looks like and what should be expected result?

Not applicable

Re: sum(Amount) with lastest version of every Key

Now I have the problem, that the versionnr arent the same, by keynr ..

some keynr has version 5 as max, other version 3 as max(version),

so how can I set all max version of several keynr?

hrlinder
Honored Contributor

Re: sum(Amount) with lastest version of every Key

sorry I donot understand your requirements

can you post a small example application?

Not applicable

Re: sum(Amount) with lastest version of every Key

KeynrVersHmax(version) of each Keynr->sum(LineAmountA)
123
243
3545
464
476
544
554
565

this is the table what I#ve got:

if I use :

money(sum({< VersH={$(=max(VersH))}>}LineAmountA))

It only shows/sum the key within max(versH) --> in this example =7

..

so, how can I sum all the key with their max(Versh) ?

to get this:

KeynrVersHsum...
123
243
3545
476
565
hrlinder
Honored Contributor

Re: sum(Amount) with lastest version of every Key

I used a small inline table with your data and I got your final table

please have a look if that's what you want

Not applicable

Re: sum(Amount) with lastest version of every Key

nearly..

what I need to sum is not 74.

I need:

3+3+45+5+6=62

Re: sum(Amount) with lastest version of every Key

aggr(max(Amount),KeyNr)

16-Apr-15 4-05-40 PM.jpg

Community Browser