code: def lagged_in_date(x=None, y=None, filter_dict=None, model='WikiItem', app=DEFAULT_APP, sort=True, limit=30000, lag=1, pad=0, truncate=True):
      lag = int(lag or 0)
      if isinstance(x, basestring) and isinstance(y, basestring):
          x, y = sequence_from_filter_spec([find_synonymous_field(x), find_synonymous_field(y)], filter_dict, model=model, 
                                           app=app, sort=sort, limit=limit)
      if y and len(y) == len(x):
          if sort:
              xy = sorted(zip(x,y), reverse=bool(int(sort) < 0))
              x, y = [col1 for col1, col2 in xy], [col2 for col1, col2 in xy]
          return x, lagged_seq(y, lag=lag, pad=pad, truncate=truncate)
      if x and len(x) and 2 == len(x) <= len(x[0]):
          x, y = x[0], lagged_seq(x[1], lag=lag, pad=pad, truncate=truncate)
          if truncate:
              print truncate, lag
              if lag >= 0:
                  x = x[lag:]
              else:
                  x = x[:lag]
      return x, y