10 Replies Latest reply: Jun 22, 2018 7:18 AM by Sunny Talwar

# set analysis doesn't work well

Hi all,

I have some problems with this set analysis:

max({\$<CampaignYear={"\$(=Max(CampaignYear)-1)"}>}Score)

I attached the file output, I don't get why I cannot see the data from  the previews year..

Thanks for any helps

• ###### Re: set analysis doesn't work well

Your set analysis is basically saying "show the max score where Year = 2017".

To achieve what you want you need to use the above() function.  This blog post should help:  The Above Function

• ###### Re: set analysis doesn't work well

Hi

I think it is working well because your max year = 2018.. so max year -1 = 2017 and data is populated for 2017

• ###### Re: set analysis doesn't work well

So I would populate that for all rows...

How I should write it?

any idea?

• ###### Re: set analysis doesn't work well

Hi.

try this

Sum({\$<CampaignYear={"\$(=Max(CampaignYear)-1)"}>}Score)

• ###### Re: set analysis doesn't work well

it doesn't work, I achieve the some results..just populate for 2017

• ###### Re: set analysis doesn't work well

The max(CampaignYear) always return 2018, then it just populate for 2017.

I think you should check Above() function as Colin Hancox mentioned above.

Above(max(score))

• ###### Re: set analysis doesn't work well

Hi I don't think that Above could be a solution, because the table that you can see in the picture, is a filtered table.

I needed maybe just to change the set expression and not populate the max score for just 2017 (max Year -1), but for all of them.

• ###### Re: set analysis doesn't work well

That would just give you the same as max(Score).  If you want to show the value from a different row, e.g., the 2017 value on the 2018 row, then you'll need to use an inter-record function such as above().  Alternatively you could do it in your load script using peek() or previous(), or by creating a table with Year-1 as a dimension and then joining that to your original table.

• ###### Re: set analysis doesn't work well

I agree with you. An easiest way is to add a new dummy calculation column in data load namely Previous_Campaigned_Year= Campaigned_Year - 1

then make the set analysis like:

max( {<CampaignYear= P(Previous_Campaigned_Year) >}  Score)

• ###### Re: set analysis doesn't work well

I agree with some of the response below that you need above() function here.... have you given it a go?

Above(Max(Score))