Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
JustinRamsey
Creator
Creator

Set Analysis Help Needed

So I have an issue with a set analysis formula that I cannot figure out what is wrong with it. I am trying to have the formula display the value of (AFPO.WEWRT/AFPO.PSMNG) where the ProductionStartMonth (formatted as a date MM-YYYY) is the maximum which would display the newest price per unit. 

The formula I came up with is MAX({<ProductionStartMonth=MAX(ProductionStartMonth)>} (AFPO.WEWRT/AFPO.PSMNG)) but that isnt working. The error message starting after the }. What am I missing with this?

15 Replies
sunny_talwar

Seems like what you really need is a FirstSortedValue() function instead of set analysis.... 

JustinRamsey
Creator
Creator
Author

I've never used that function. Can you assist me with its syntax? Tried

 FirstSortedValue(AFPO.AUFNR, AFPO.STRMP, 1) as NewestOrder,

Where AFPO.AUFNR is the Production order number. but it errors out. 

sunny_talwar

You need to do this in the script?

JustinRamsey
Creator
Creator
Author

I dont need to I thought that was where the function was usually implemented per the examples I saw. 

sunny_talwar

Can be implemented on the front end as well. firstsortedvalue

I don't think I can give you the exact expression without testing it out based on your dimension and expectation, but feel free to try it out.

JustinRamsey
Creator
Creator
Author

Appears this may be working. Have to have a coworker verify in the system.

FirstSortedValue((AFPO.WEWRT/AFPO.PSMNG), -AFPO.STRMP, 1)