Cannot do the eq in https://dgraph.io/tour/blocksvars/11

Run this at Dgraph Ratel Dashboard

{
  directorids as debug(func: gt(count(director.film), 200), first:10, orderdesc:  name@.) {
     name@.
    director.film @normalize {
      initdate as initial_release_date
    }
    recently_release as max(val(initdate))
  }
    me(){
      test: max(val(initdate))
      test2: max(val(recently_release))
    }
  
  hello(func: uid(directorids), orderdesc:  name@.) @cascade {
    name@.
    recently_release_date : val(recently_release)
    directorfilm : director.film @filter(eq(initial_release_date, val(recently_release) )) @normalize {
     movieName :  name@.
      initial_release_date : initial_release_date
    }
  }  
}

As you can see in the result below, all other queries are “contaminated” with values collected previously.

Your use case has not been thought of before. There was no such intention. For aggregations are used via the empty blocks (As in the case of the “me” block) to apply later on another block.

It may be possible to fix this instead of adding a new feature, as it is obviously similar to a bug (and it is already known), but that is part of the design.

See, other use cases are affected by this design Standard Deviation - #4 by MichelDiz

No, it won’t work that way, that’s the “bug”.

Overall, I would recommend doing this at the application (Your end) level for now.

Result

{
  "data": {
    "debug": [
      {
        "name@.": "Keith Miller",
        "max(val(initdate))": "2010-05-05T00:00:00Z"
      },
      {
        "name@.": "Georges Méliès",
        "max(val(initdate))": "2007-11-01T00:00:00Z"
      },
      {
        "name@.": "Friz Freleng",
        "max(val(initdate))": "2012-03-06T00:00:00Z"
      },
      {
        "name@.": "D. W. Griffith",
        "max(val(initdate))": "1951-01-01T00:00:00Z"
      },
      {
        "name@.": "Chuck Jones",
        "max(val(initdate))": "2011-12-07T00:00:00Z"
      },
      {
        "name@.": "Chi Chi LaRue",
        "max(val(initdate))": "2010-07-30T00:00:00Z"
      },
      {
        "name@.": "Charles Lamont",
        "max(val(initdate))": "1956-07-20T00:00:00Z"
      }
    ],
    "me": [
      {
        "test": "2012-03-06T00:00:00Z"
      },
      {
        "test2": "2012-03-06T00:00:00Z"
      }
    ],
    "hello": [
      {
        "name@.": "Keith Miller",
        "recently_release_date": "2010-05-05T00:00:00Z",
        "directorfilm": [
          {
            "movieName": "Spanking Curiosity 4",
            "initial_release_date": "2010-05-05T00:00:00Z"
          }
        ]
      },
      {
        "name@.": "Georges Méliès",
        "recently_release_date": "2007-11-01T00:00:00Z",
        "directorfilm": [
          {
            "movieName": "Satan in Prison",
            "initial_release_date": "2007-11-01T00:00:00Z"
          }
        ]
      },
      {
        "name@.": "Friz Freleng",
        "recently_release_date": "2012-03-06T00:00:00Z",
        "directorfilm": [
          {
            "movieName": "Looney Tunes Super Stars' Pepe Le Pew: Zee Best of Zee Best",
            "initial_release_date": "2011-12-07T00:00:00Z"
          },
          {
            "movieName": "Ballot Box Bunny",
            "initial_release_date": "1951-01-01T00:00:00Z"
          },
          {
            "movieName": "The Best of Bugs Bunny",
            "initial_release_date": "2012-03-06T00:00:00Z"
          }
        ]
      },
      {
        "name@.": "D. W. Griffith",
        "recently_release_date": "1951-01-01T00:00:00Z",
        "directorfilm": [
          {
            "movieName": "Footlight Varieties",
            "initial_release_date": "1951-01-01T00:00:00Z"
          }
        ]
      },
      {
        "name@.": "Chuck Jones",
        "recently_release_date": "2011-12-07T00:00:00Z",
        "directorfilm": [
          {
            "movieName": "Drip-Along Daffy",
            "initial_release_date": "1951-01-01T00:00:00Z"
          },
          {
            "movieName": "Looney Tunes Super Stars' Pepe Le Pew: Zee Best of Zee Best",
            "initial_release_date": "2011-12-07T00:00:00Z"
          },
          {
            "movieName": "Rabbit Fire",
            "initial_release_date": "1951-01-01T00:00:00Z"
          }
        ]
      },
      {
        "name@.": "Chi Chi LaRue",
        "recently_release_date": "2010-07-30T00:00:00Z",
        "directorfilm": [
          {
            "movieName": "Falcon Four Hours - Muscle Madness",
            "initial_release_date": "2010-07-30T00:00:00Z"
          }
        ]
      },
      {
        "name@.": "Charles Lamont",
        "recently_release_date": "1956-07-20T00:00:00Z",
        "directorfilm": [
          {
            "movieName": "Francis (the talking mule) in the Haunted House",
            "initial_release_date": "1956-07-20T00:00:00Z"
          }
        ]
      }
    ]
  }
}