Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
mayuridg
Contributor

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

Re: Max with Firstsortedvalue

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))

5 Replies

Re: Max with Firstsortedvalue

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))

mayuridg
Contributor

Re: Max with Firstsortedvalue

if i want sequentially previous PO then ?

Re: Max with Firstsortedvalue

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

mayuridg
Contributor

Re: Max with Firstsortedvalue

Hi Sunny,

Thanks a ton .. its working..

Re: Max with Firstsortedvalue

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

Community Browser