Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Need Help In set Analysis for MAx Value

Hello!  I need help in my set analysis in my pivot table  to get the max value...get the  latest award Award Value  based on Max date by FY, FQ and Company even if the Qty is 0

Here is my sample data

   

DateCompanyFYFQAwardQty
10/26/2014A2015Q11515
10/27/2014A2015Q115200
10/28/2014A2015Q130300
10/29/2014A2015Q130400
10/30/2014A2015Q1300
10/26/2014B2015Q120400
10/27/2014B2015Q115500
10/28/2014B2015Q120600
10/29/2014B2015Q145200
10/30/2014B2015Q12020
1/25/2014A2015Q21550
1/26/2014A2015Q230100
1/27/2014A2015Q22030
1/28/2014A2015Q23020
1/29/2014A2015Q2800
1/30/2014B2015Q215400
1/31/2014B2015Q230500
2/1/2014B2015Q220600
1/25/2014B2015Q220200
1/26/2014B2015Q21020

I tries using the formula  but doesn't work...When I select  FY2015 Q4, only the row with more than  0 qty will show up...I want all awards to show up even if  its 0 qty...

=only({<FY=,FQ=,Company=,Qty=,Date={"$(=MaxString(Date))"}>}Award)

   

  This is my desired results :

   

DateCompanyFYFQAward
10/30/2014A2015Q130
10/30/2014B2015Q120
1/29/2014A2015Q280
1/26/2014B2015Q210

I hope you can help me on this ...

Tks.

12 Replies
sunny_talwar

Try this expression: =Aggr(FirstSortedValue(Award, -Date), Company, FQ)

Dimension: Date, Company, FY, FQ

Output:

Capture.PNG

sunny_talwar

Newer version, disregard the previous post

Capture.PNG

Expression1: =FirstSortedValue(Date, -Date)

Expression2: =FirstSortedValue(Award, -Date)

Dimensions: Company, FQ, FY

Attaching the qvw for reference.

Best,

Sunny

sunny_talwar

Also, just to make sure I am understanding it correct. In the below image the circled part is the one you want and not the yellowed part, right?

Capture.PNG

Anonymous
Not applicable
Author

HI!  Sunindia,
Thank you for your prompt response...  Sorry for the confusion but I want the results in yellow... However,I actually made a typo in my sample table...
It's supposed to be like this

   

DateCompanyFYFQAwardQty
10/26/2014A2015Q11515
10/27/2014A2015Q115200
10/28/2014A2015Q130300
10/29/2014A2015Q130400
10/30/2014A2015Q130200
10/26/2014B2015Q120400
10/27/2014B2015Q115500
10/28/2014B2015Q120600
10/29/2014B2015Q145200
10/30/2014B2015Q12020
1/25/2014A2015Q21550
1/26/2014A2015Q230100
1/27/2014A2015Q22030
1/28/2014A2015Q23020
1/29/2014A2015Q2800
1/25/2014B2015Q215400
1/26/2014B2015Q230500
1/27/2014B2015Q220600
1/28/2014B2015Q220200
1/29/2014B2015Q21020
This is the desired results :...Thus, should be only 1 date per FY, FQ and Award...

 

   

DateCompanyFYFQAwardQty
10/30/2014A2015Q130200
10/30/2014B2015Q12020
1/29/2014A2015Q2800
1/29/2014B2015Q21020

 

Tks.

   

sunny_talwar

Output:

Capture.PNG

Expression1: =FirstSortedValue(Date, -Date)

Expression2: =FirstSortedValue(Award, -Date)

Expression3: =FirstSortedValue(Qty, -Date)

Dimensions: Company, FQ, FY

HTH

Best,

Sunny

Anonymous
Not applicable
Author

Hi!  This one looks better...However, I noticed for the  0 Qty , it creates a new row f "Unknown"   Company...Is there anyway, to get rid  of these?

Tks.

sunny_talwar

Hi!  This one looks better...However, I noticed for the  0 Qty , it creates a new row f "Unknown"   Company...Is there anyway, to get rid  of these?

Not sure what you mean here?

Anonymous
Not applicable
Author

Oh Ok...I have fixed the Unknown ...It's bec...I have added the first sorted value for Company... I took it out and its gone......But the Award  for the 0 qty doesn't show up...Thus, only 1 row showed up  (with more than 1  qty) for each quarter.

Tks.

sunny_talwar

So all is working now then?