Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
vmehta23
Contributor
Contributor

Using Sum and another function

Hello,

My data looks something like this:

Total Mobile CostsPeriod
6010
1787
2912
19910
1168
3501
482
2754
2997
42511
1667
36
3592
45010
1009
31410
74
4556
487
717

 

I am trying to sum the Total Mobile costs based on the current selected filter (I have a filter on the sheet to choose period 1-12). So I am trying to display the previous "Period"  from current selected Period number e.g I select from filter to show Period 10 so the formula show the sum of total mobile costs of Period 9.

This is the formula I thought might work but it doesn't...:

Sum({$<Period ={(Period)-1}>}[Total Mobile Cost])

Hope my issue makes sense!

Thanks

Labels (2)
1 Solution

Accepted Solutions
sunny_talwar

Try this

Sum({$<Period = {$(=Max(Period)-1)}>} [Total Mobile Cost])

View solution in original post

2 Replies
sunny_talwar

Try this

Sum({$<Period = {$(=Max(Period)-1)}>} [Total Mobile Cost])
vmehta23
Contributor
Contributor
Author

Works exactly as intended, thank you!