Forum Discussion

Parkyerbike's avatar
Parkyerbike
New Member
2 years ago
Solved

Confused - iterating over values

Hello, I am after some help if possible.

 

I have a table, that contains a list of unique customer names. I have another table that contains details about that customer, this has a list of installations (not unique) and what I would really like to do, is create a column in customer name, that has the latest version of the software, based on date and subsys where the environment is set to production

 

So, as an example, I would like the customer table to end up something like this, with an entry for each customer, based on the latest date from another table, based on subsys = CR and environment = production

 

Customer Table - Key = ID

 

Patch Table - Key is IdentifiedInstallationID

 

So I am thinking I would need to iterate over the dates, per IdentifiedInstallationID where SubSys = CR and Environment = production and bring back the latest entry

 

Thanks in advance

 

  • Hi,

    Enter this calculated column formula in Table1

    Column = LOOKUPVALUE(Table2[Software Name],Table2[Date Patch Applied],CALCULATE(MAX(Table2[Date Patch Applied]),FILTER(Table2,Table2[ID]=EARLIER(Table1[ID])&&Table2[Environment]="Production"&&Table2[Subsys]="CR")),Table2[ID],Table1[ID])

    Hope this helps.

     

3 Replies

  •  

    IDCustomer NameSoftware Version (Trying to generate this)
    1ABC CoVersion 3
    2Fred BloggsVersion 2
    3A Company 
    4B Company 
    5C Company 

     

    Trying to create the above column, based on sample data below

     

    Where the Environment = Production, the Subsys is CR and the latest date in the list per ID

     

    IDEnvironmentDate Patch AppliedSubsysSoftware Name
    1Production1/2/24CRVersion 1
    1Production3/2/24CRVersion 2
    1Production5/2/24CRVersion 3
    1Staging3/2/24CRVersion 4
    2Production3/2/24ABVersion 4
    2Production5/2/24CRVersion 2

     

    Hope that helps

     

    Thanks

    • Ashish_Mathur's avatar
      Ashish_Mathur
      Super User

      Hi,

      Enter this calculated column formula in Table1

      Column = LOOKUPVALUE(Table2[Software Name],Table2[Date Patch Applied],CALCULATE(MAX(Table2[Date Patch Applied]),FILTER(Table2,Table2[ID]=EARLIER(Table1[ID])&&Table2[Environment]="Production"&&Table2[Subsys]="CR")),Table2[ID],Table1[ID])

      Hope this helps.