# Qlik Sense App Development

Contributor II

## Set Analysis Help

Here is my formula:

Sum({<[Activity Freeze Month Year Index] =Max({<[Month Year]=,Year = {'\$(=Max({<[Month Year]=>}

[Activity Freeze Year])-2)'}>}[Activity Freeze Month Year Index])>}[PL Counter])

If I just put :

=Max({<[Month Year]=,Year = {'\$(=Max({<[Month Year]=>}   [Activity Freeze Year])-2)'}>}[Activity Freeze Month Year Index])

in a text box it works and returns a 12, but it's not working inside the formula. Please let me know if you have any ideas!

Thanks,

Erica

1 Solution

Accepted Solutions
MVP

## Re: Set Analysis Help

Try this

Sum({<[Activity Freeze Month Year Index] = {"\$(=Max({<[Month Year], Year = {'\$(=Max({<[Month Year]>} [Activity Freeze Year]) - 2)'}>} [Activity Freeze Month Year Index]))"}>} [PL Counter])

2 Replies
Esteemed Contributor

## Re: Set Analysis Help

Hi,

your set analysis syntax is incorrect:

you should write it like this:

aggregation_function(    {<  FIELD={ }  >}    FIELD)

MVP

## Re: Set Analysis Help

Try this

Sum({<[Activity Freeze Month Year Index] = {"\$(=Max({<[Month Year], Year = {'\$(=Max({<[Month Year]>} [Activity Freeze Year]) - 2)'}>} [Activity Freeze Month Year Index]))"}>} [PL Counter])