Identifying the max value for a specific field

Hi, i do like a dilemma it seems...

 

I have a list with 2 fields (well lots but 2 that matter) Bvfsku and Vintage

latestvintage.PNG

I want to add a field that indicates the one that has the latest vintage (2018 in this example)

So a boolean or a number field that is set to TRUE or 1 if the Vintage is the latest year....

How can i do that please?

 

Answers not on  postcard please, thanks in advance

 

Kev

 

 

 

Best Answer

  • VIGNESH.M
    Answer ✓

    Hi,

     

    Your Bvfskus column should be list formated to get this. If your column is text format, create another line item and convert into List format using FINDITEM.

    Try this.

    001.png2.png

     

    Regards,

    Vignesh M

     

Comments

  • Hi,

     

    Use Max as summary of the vintage line item and use the below logic.

    001.png

    Regards,

    Vignesh M

  • @DeveloperCYT 

    1. Set up a Lookup module (no dimensions) in which you set the vintage year.  You can calculate this from the Current period (if that is what you want)

    2019-08-15_10-31-04.pngIn the above, Target year is formatted as Year and Year is formatted as a number

     

    I hope that helps

    David 

     

  • but i have 2000 Bvfskus, so i need to find the maximum year for each Bvfsku, not all bvfsku's 

  • Sorry David, i don't need to find the current year, i need to find the last vintage for each bvfsku (We have 2000+) so if the last was 2016 then i can identify it as such.

  • @DeveloperCYT 

    Have a look at this

     

    https://help.anaplan.com/anapedia/Content/Calculation_Functions/All/xMAX_y.html

     

    I think this is what you need - You might need another line item to hold the name/code of the list item and then bring that through. You could then use that to match

     

    You might also need the FIRSTNONBLANK aggregation to move the formatted list items between modules

    Have a look here too

    https://help.anaplan.com/anapedia/Content/Calculation_Functions/CF_Aggregation_Functions.html

     

    Hope this helps

    David

    David

  • HI @DeveloperCYT,

    Try my below approach!!

    Step 1: Create below line items in your module and apply the formula.

    Identifying the max value for a specific field.PNG

     

    Step 2: Create a module with 'Bvfsku' list and create one line item.

     Identifying the max value for a specific field 1.PNG

    End Result:

     

    Identifying the max value for a specific field 2.PNG

     Note: 1. You should have 'Bvfsku' list if not please create. 2. If you have 'Year' as a number formatted then you can directly refer else convert by the above approach.

    I hope this helps!

    Regards,
    Kavin.

     

  • @DeveloperCYT 

    2 simple solutions depending on your list structure

     

    1. Assuming you have a composite list

    You can use the MAX summary method and a LOOKUP on the parent of the list

    2019-08-15_13-57-52.png

    2. Assuming it is not a composite list, but you still have the attibributes

    Create a module by the attribute using the MAX aggregate parameter and then use a LOOKUP similar to 1.

    2019-08-15_13-58-36.png

     

    2019-08-15_13-59-03.png

     

    Hope that helps.

    David