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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
beck_bakytbek
Master
Master

only last value

Hi Folks,

i have one problem,

i use this expression:

M2:

sum(aggr(rangesum(below(total sum({<Month=>}Amount),1,2)),Month)) ,it does work great,

but i want see only last value of selected period, how can i make invisible other value / or to set to Zero.

thanks a lot

beck

1 Solution

Accepted Solutions
Anonymous
Not applicable

if(rowno(total)=noofrows(total),

sum(aggr(rangesum(below(total sum({<Month=>}Amount),1,2)),Month))

)

View solution in original post

14 Replies
sunny_talwar

May be this:

FirstSortedValue(Aggr(RangeSum(Below(TOTAL Sum({<Month=>}Amount), 1, 2)), Month)), -Month)

Anonymous
Not applicable

if(rowno(total)=noofrows(total),

sum(aggr(rangesum(below(total sum({<Month=>}Amount),1,2)),Month))

)

beck_bakytbek
Master
Master
Author

Sunny

Thanks a lot

beck_bakytbek
Master
Master
Author

Robin

Thanks a lot

beck_bakytbek
Master
Master
Author

Hi Robin.

i have one question, i have in this case two types of amount, and when i use the set expression, my expression doesnt work

2 types of my amount: UK and USA

i use this expression:

if(rowno(total)=noofrows(total),

sum(aggr(rangesum(below(total sum({<Type = {'UK'},Month=>}Amount),1,2)),Month))

)

do you have any idea?

thanks a lot

beck

beck_bakytbek
Master
Master
Author

Hi Sunny.

thanks for your feedback,  i have in this case two types of amount, and when i use the set expression, my expression doesnt work

2 types of my amount: UK and USA

i use this expression:

if(rowno(total)=noofrows(total),

sum(aggr(rangesum(below(total sum({<Type = {'UK'},Month=>}Amount),1,2)),Month))

)

do you have any idea?

thanks a lot

beck

sunny_talwar

Not certain, but may be this

If(RowNo(TOTAL) = NoOfRows(TOTAL),

Sum({<Type = {'UK'}>} Aggr(RangeSum(Below(TOTAL Sum({<Type = {'UK'}, Month=>}Amount), 1, 2)), Month)))

beck_bakytbek
Master
Master
Author

Hi Sunny,

thanks a lot for your help,

but i implemented this code in my expression, and it does not work

beck

sunny_talwar

When you say it doesn't work, do you mean it gives an error? doesn't show anything? show incorrect result?