When defining a new array for a local variable, I would like to separate the values to be stored when the existing array is NULL and when it is not. Is it possible? ローカル変数に新しい配列を定義するとき、既存の配列がNULLのときとそれ以外で格納する値を分けたいです。実現可能でしょうか?

I am always indebted. I have a question for all you kind people.
Store the array obtained from the record type in the first local variable.
Stores a new array that adds part of the value of the first local variable to the second local variable.
This second local variable will be used to display the graph.

The first local variable stores data corresponding to the rule input value, if any. However, in rare cases, the value entered may not exist for the record type being queried. At this time, the value of the first local variable will be [].

Here comes the problem. When defining the value of the second local variable, there is no problem if the first local variable has a value other than []. However, if it is [], the addition process will not be possible and an error will occur. I would like to solve this problem, but are there any appropriate functions or ideas?

When defining the second local function, if I included an IF function or a NULL check, the variable definition did not work. If anyone knows, please let me know. Thank you.

いつもお世話になっています。親切な皆様に質問があります。
1つめのローカル変数に、レコードタイプから取得した配列を格納します。
2つめのローカル変数に、1つ目のローカル変数の値の一部を加算した新しい配列を格納します。
この2つめのローカル変数を、グラフの表示に使用します。

1つめのローカル変数には、ルール入力された値がある場合はそれに応じたデータを格納します。しかしまれに、入力された値がクエリ対象のレコードタイプに存在しないケースがあります。このとき、1つめのローカル変数の値は [] になります。

ここで問題が発生します。2つ目のローカル変数の値を定義するとき、1つめのローカル変数が [] 以外の値であれば問題ありません。しかし[]だった場合は、加算の処理ができずにエラーが発生します。この問題を解決したいのですが、適切な関数や工夫はありますでしょうか?

2つめのローカル関数を定義する際にIF関数やNULLチェックを挟むと変数定義がうまくいきませんでした。もしご存じの方がいれば教えて頂きたいです。よろしくお願いいたします。

  Discussion posts and replies are publicly visible

Parents Reply Children
  • thank you.
    The code I'm trying to achieve is below.
    This is a temporary name, but we will use two local variables: "aaaBbb" and "aaaBbb2". The former is the result of querying the record type, and may contain a value or be NULL, which is the expected specification.
    If NULL is stored in the former, an error will occur when defining the latter variable. However, a NULL value should remain NULL, and if there is a value, the calculated value should be used. We are struggling to achieve both. I'm thinking of something I can do by embedding expression rules. Thank you.

    local!aaaBbb2:
    if(isnull(local!aaaBbb),
    {
    local!yosan[1],
    local!yosan[1]+local!yosan[2],
    ...
    },
    ""
    ),

    ありがとうございます。
    達成しようとしているコードは以下の通りです。
    これは仮の名前ですが「aaaBbb」「aaaBbb2」の2つのローカル変数を使用します。前者はレコードタイプをクエリした結果で、値が入っている場合もNULLの場合もあり、想定通りの仕様です。
    前者にNULLが格納されていた場合、後者の変数定義時にエラーが発生します。しかし、NULLの値はNULLのまま、値がある場合はその値を計算したものを使用する必要があります。この両者を実現するのに苦心しています。式ルールの埋め込みなどで何とかできないか考え中です。よろしくお願いいたします。

    local!aaaBbb2:
    if(isnull(local!aaaBbb),
    {
    local!yosan[1],
    local!yosan[1]+local!yosan[2],
    ...
    },
    ""
    ),