Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
The #1 reason QlikView customers adopt Qlik Sense is a desire for a modern BI experience. Read More
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

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

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

Highlighted
Contributor III
Contributor III

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. 

Highlighted

You need to do this in the script?

Highlighted
Contributor III
Contributor III

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

Highlighted

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.

Highlighted
Contributor III
Contributor III

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

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