您是否可以IFERROR Importxml

时间:2019-02-09 06:49:15

标签: google-sheets-query google-sheets-formula

我是初学者。我有下面的公式,适用于从表中将payment date用于有股息的股票(A9是股票行情自动收录器),但不适用于没有股息的股票(无表格)。
我得到:

#value -"unable to parse query string from function query parameter 2: no column:Col6"

我希望它在没有红利的情况下返回0.00。谢谢

=QUERY(IMPORTXML(CONCATENATE("https://www.nasdaq.com/symbol/",A9,"/dividend-history"),"//tbody//tr[1]"),"select Col6 LIMIT 1")

1 个答案:

答案 0 :(得分:0)

IFERROR包装应该足够:

      var app = angular.module('srsApp', []);
      app.controller('userRole', function($scope) {
        $scope.roles = ['Professeur', 'Élève'];
        $scope.user = {role:'', name:'', isSetup: false};

        $scope.setProfile = function() {
          if ($scope.userName !== '' && $scope.userRole !== '') {
            $scope.user.role = $scope.userRole;
            $scope.user.role = $scope.userName;
            $scope.user.isSetup = true;
            $scope.userRole = '';
            $scope.userName = '';
          }
        };
      });
    </script>