4 Replies Latest reply: May 14, 2012 10:22 AM by Thomas Mumaw

# Calculation Question (Set Analysis vs. "If")

Hello All,

I am have a small issue trying to get something to work using set analysis and thought maybe someone out here could help.  The first statement works fine, but the second one using set analysis does not.  I was wondering if I am doing something wrong.  Thanks  Thom

1)    Sum(if(Contract_End_Date_Num >= Roll_Out_Date_Num, ExtendedAmount))

2)    Sum({<Contract_End_Date_Num = {">= Roll_Out_Date_Num"}>} ExtendedAmount)

• ###### Re: Calculation Question (Set Analysis vs. "If")

Tmumaw,

Yes it is wrong way of using set analysis.

Note:

Your first expression will gives the data in loading process i.e 1 by 1 check. When coming to second expression you should assign value to compare.

For example:

sum( {\$<Year = {2000}, Region = {US, SE, DE, UK, FR}>} Sales )

sum( {\$<Year = {“>1978<2004”}>} Sales )

coming to your expression you should compare either max or min of Roll_Out_Date_Num.

Sum({<Contract_End_Date_Num = {">=\$(= Min(Roll_Out_Date_Num))"}>} ExtendedAmount)

Hope it helps you..

Cheers !

• ###### Re: Calculation Question (Set Analysis vs. "If")

Thanks Jagan that worked perfectly.  You don't know how long I have been looking at that statement wondering why it would not work.  Have a great day.  I know I will now.

Thom

• ###### Re: Calculation Question (Set Analysis vs. "If")

I didn't get what you said? But one think i want to know whether you had find solution yourself or my solution helped you?

If you find solution can you share with us. B'coz you ticked your post as correct.

• ###### Re: Calculation Question (Set Analysis vs. "If")

Your's worked perfectly.  Thanks