Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Denzyl
Contributor II
Contributor II

Sum expression by variable with calculation

I am trying to create a Sum expression with a condition based on a variable minus n.  

I have a variable vLatestMonth which has the value of 7. 

I am trying to sum the [amount] column where the [month] column is equal to vLatestMonth minus one. 

I have tried the following code but received the following error message:

SUM({<[month]={$(vLatestMonth)-1}>}[amount])

Error in set modifier ad hoc element list: ',' or ')' expected
 
 
Labels (1)
1 Solution

Accepted Solutions
Denzyl
Contributor II
Contributor II
Author

I have found a solution:

 

SUM({<[month]={$(=vLatestMonth-1)}>}[amount])

 

View solution in original post

1 Reply
Denzyl
Contributor II
Contributor II
Author

I have found a solution:

 

SUM({<[month]={$(=vLatestMonth-1)}>}[amount])