Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Aggr function help!?

Hi All,

I have hit a brick wall with the Aggr function. I basically want to show the latest record for a summary of spend, but ensure that the total spend is a sum of all prior records. The reason being that suppliers information changes over time and I just need the latest record of detail. I have created an indicator to give me the max date and the expression for the straight table is as follows:

Aggr(sum({<Latest_record_indicator>}),[Amount])

Now the indicator, when selected works in some cases, but in other cases, I am losing records. When I make other selections, Category for example, it throws my balances completely off. I tried applying this logic but it still doesnt balance:

Aggr(sum({<Latest_record_indicator,Category>}),[Amount])

Anyone have any suggestions or similar experiences?

2 Replies
swuehl
MVP
MVP

I don't think that this

Aggr(sum({<Latest_record_indicator>}),[Amount])

is valid syntax, it seems you're missing the expression to aggregate in your sum() function.

Then, just using set expression

{<Latest_record_indicator>}

is just clearing any selections in Latest_record_indicator field, it is not filtering your data for latest records (or have I misunderstood what you are trying to show here?).

Finally, I think you need an aggregation function around the aggr() function, to aggregate the table returned from the aggr() function (there are special cases where you don't explicitely need one, but in most cases, you do).

Could you post a small sample app here?

Regards,

Stefan

sujeetsingh
Master III
Master III

Yes it will be right to have a sample copy.