Lookup Function does not work

Posted by: didem.kahyaoglu on 23 May 2023, 10:50 pm EST

    • Post Options:
    • Link

    Posted 23 May 2023, 10:50 pm EST - Updated 23 May 2023, 10:51 pm EST

    My data is nested. Here is some part of my data ;

     {
        "_id": {
          "$oid": "639714f6dc06372526070821"
        },
        "Run": {
          "Date": {
            "$date": "2022-12-12T11:48:06Z"
          },
          "Index": 1,
          "Scenario": {
            "Name": "YZU_senaryo1",
            "Database": "default"
          },
          "Svn": {
            "Address": "",
            "Revision": 0
          }
        },
        "Statistics": {
          "Platforms": [
            {
              "Profile": "F-16C",
              "Type": "Wing",
              "Force": "Blue",
              "Total": 1,
              "Wrecked": 0,
              "Destroyed": 0
            },
            {
              "Profile": "F-16C_1",
              "Type": "Wing",
              "Force": "Blue",
              "Total": 1,
              "Wrecked": 0,
              "Destroyed": 0
            },
            {
              "Profile": "Oliver Hazard Perry Class_1",
              "Type": "Surface",
              "Force": "Red",
              "Total": 1,
              "Wrecked": 0,
              "Destroyed": 0
            }
          ],
          "Weapons": [
            {
              "Profile": "SOM-J",
              "Type": "MissileTracking",
              "Force": "Blue",
              "Total": 2,
              "Hit": 0,
              "Missed": 2
            },
            {
              "Profile": "RIM-66CSM-1",
              "Type": "MissileTracking",
              "Force": "Red",
              "Total": 2,
              "Hit": 2,
              "Missed": 0
            }
          ]
        },
        "Variables": [
          {
            "Name": "V_0",
            "Type": "PlatformRelativeBearing",
            "Configuration": "InitialValue: 0 Increment: 30 FinalValue: 330 AnchorPlatformName[Destroyer] PlatformName[Fighter_1]",
            "Vaue": 0,
            "index" : 0
          },
          {
            "Name": "V_1",
            "Type": "PlatformRelativeBearing",
            "Configuration": "InitialValue: 30 Increment: 30 FinalValue: 360 AnchorPlatformName[Destroyer] PlatformName[Fighter_2]",
            "Vaue": 30,
            "index" : 0
          },
          {
            "Name": "V_2",
            "Type": "PlatformRelativeDistance",
            "Configuration": "InitialValue: 50000 Increment: 50000 FinalValue: 100000 AnchorPlatformName[Destroyer] PlatformName[Fighter_1]",
            "Vaue": 50000,
            "index" : 0
          },
          {
            "Name": "V_3",
            "Type": "PlatformRelativeDistance",
            "Configuration": "InitialValue: 50000 Increment: 50000 FinalValue: 100000 AnchorPlatformName[Destroyer] PlatformName[Fighter_2]",
            "Vaue": 50000,
            "index" : 0
          },
          {
            "Name": "V_4",
            "Type": "WeaponRange",
            "Configuration": "InitialValue: 10000 Increment: 10000 FinalValue: 50000 WeaponName[RIM-66CSM-1] []",
            "Vaue": 50000,
            "index" : 0
          },
          {
            "Name": "V_5",
            "Type": "LoadedWeaponCount",
            "Configuration": "InitialValue: 1 Increment: 1 FinalValue: 4 PlatformName[F-16C] [SOM-J]",
            "Vaue": 1,
            "index" : 0
          },
          {
            "Name": "V_6",
            "Type": "LoadedWeaponCount",
            "Configuration": "InitialValue: 1 Increment: 1 FinalValue: 4 PlatformName[F-16C_1] [SOM-J]",
            "Vaue": 1,
            "index" : 0
          }
        ],
        "Measurements": [
          {
            "Name": "M_0",
            "Type": "WEAPON_LAUNCH",
            "Configuration": " [Entity:Destroyer] [Force:BLUE->TARGET:SOM-J]",
            "Value": 0,
            "Details": {},
            "index" : 0
          },
          {
            "Name": "M_1",
            "Type": "WEAPON_LAUNCH",
            "Configuration": " [Force:RED->WEAPON:RIM-66CSM-1] [Force:BLUE->TARGET:SOM-J]",
            "Value": 2,
            "Details": {
              "AverageRange": 24813.617910990804,
              "Range": [24880.192418916515, 24747.043403065098]
            },
            "index" : 0
          },
          {
            "Name": "M_2",
            "Type": "WEAPON_HIT",
            "Configuration": " [Force:BLUE->WEAPON:SOM-J] [Entity:Destroyer]",
            "Value": 0,
            "Details": {},
            "index" : 0
          },
          {
            "Name": "M_3",
            "Type": "WEAPON_INTERCEPT",
            "Configuration": " [Force:BLUE->WEAPON:SOM-J] [Entity:Destroyer] [Force:RED->INTERCEPTOR:RIM-66CSM-1]",
            "Value": 2,
            "Details": {
              "AverageRange": 14375.244757238168,
              "Range": [14420.824708140452, 14329.664806335886]
            },
            "index" : 0
          },
          {
            "Name": "M_4",
            "Type": "PLATFORM_DMG_PERCENT",
            "Configuration": " [Entity:Destroyer]",
            "Value": 0,
            "Details": {},
            "index" : 0
          },
          {
            "Name": "M_5",
            "Type": "WEAPON_LAUNCH",
            "Configuration": " [Force:BLUE->WEAPON:SOM-J] [Entity:Destroyer]",
            "Value": 2,
            "Details": {
              "AverageRange": 49913.82936430945,
              "Range": [50166.56130724897, 49661.09742136992]
            },
            "index" : 0
          },
          {
            "Name": "M_6",
            "Type": "WEAPON_MISS",
            "Configuration": " [Force:BLUE->WEAPON:SOM-J] [Entity:Destroyer]",
            "Value": 0,
            "Details": {},
            "index" : 0
          }
        ]
      }
    


    I want to show my data on Line Chart. y-axis should be MeasurmentsValues of the object with MeasurementsNames M_1 and x-axis should be VariableValues of the object with VariableNames V_1. I used Lookup function like this ;
    {Lookup("M_1", MeasurementsName, MeasurementsValue, "test")} 
    but it shows me only first MeasurementsValue not all.

    I have no clue as to why this is happening. I will be glad if you help

  • Posted 28 May 2023, 1:46 pm EST

    Hi Didem,

    If you want to show Measurements Values on Y-Axis and Variable Values on the X-Axis you can create two DataSets one for Measurements and one for Variables and bind your chart’s DataField to Measurements’s Values, and on the Category axis (X-axis) you can bind your chart using a Lookup such as

    {Lookup("V" + Name.Substring(1), Name, Vaue, "Variables")}
    

    This way your Y-Axis will hold the data for M_1, M_2, … and X-Axis will hold the date for corresponding V_1, V_2, …

    Please find attached a sample implementing the same.

    Please Note: This query has been posted on a public forum, if this contains critical or confidential data you may reach out to us and we can get the same removed from our forum. After which you may open a thread on our internal support portal for further discussion.

    Regards,

    Anand

    Chart.zip

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels