Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
QlikAngel
Partner - Creator
Partner - Creator

Max with Firstsortedvalue

Hi,

I want to add below expression , below expression is working .. but want to add in below expression stating if PO_NUMBER is Max on selection of Year or Month then only below expression should work.

=FirstSortedValue( DISTINCT Aggr(SUM({<PODTL_PHA_CREATION_YEAR = {$(vMaxYear)},PODTL_PHA_AUTHORIZATION_STATUS = {"APPROVED"} >}DISTINCT PODTL_PLA_UNIT_PRICE),

PODTL_ORGANIZATION_NAME,NEW_PODTL_ITEM_CODE,PODTL_ITEM_CODE,PODTL_PHA_CREATION_DATE),-(PODTL_PHA_CREATION_DATE),1)

how to do it please help..

1 Solution

Accepted Solutions
sunny_talwar

Not sure I understand, but may be this:

If(Max(PO_NUMBER) = Max({1} PO_NUMBER),

FirstSortedValue( DISTINCT Aggr(SUM({<PODTL_PHA_CREATION_YEAR = {$(vMaxYear)},PODTL_PHA_AUTHORIZATION_STATUS = {"APPROVED"} >}DISTINCT PODTL_PLA_UNIT_PRICE),

PODTL_ORGANIZATION_NAME,NEW_PODTL_ITEM_CODE,PODTL_ITEM_CODE,PODTL_PHA_CREATION_DATE),-(PODTL_PHA_CREATION_DATE),1))

View solution in original post

5 Replies
sunny_talwar

Not sure I understand, but may be this:

If(Max(PO_NUMBER) = Max({1} PO_NUMBER),

FirstSortedValue( DISTINCT Aggr(SUM({<PODTL_PHA_CREATION_YEAR = {$(vMaxYear)},PODTL_PHA_AUTHORIZATION_STATUS = {"APPROVED"} >}DISTINCT PODTL_PLA_UNIT_PRICE),

PODTL_ORGANIZATION_NAME,NEW_PODTL_ITEM_CODE,PODTL_ITEM_CODE,PODTL_PHA_CREATION_DATE),-(PODTL_PHA_CREATION_DATE),1))

QlikAngel
Partner - Creator
Partner - Creator
Author

if i want sequentially previous PO then ?

sunny_talwar

Not sure I understand, can you share a sample with expected output?

QlikAngel
Partner - Creator
Partner - Creator
Author

Hi Sunny,

Thanks a ton .. its working..

sunny_talwar

I am amazed it does, because I seriously had no clue about what you wanted. Well I had some clue, but was not 100% sure