steelmanot2
June 16th, 2008, 04:48 PM
Hi Guys,
I would be very grateful if you help solve the following problem.
I want to return only the first met value ot a range of values.
In the "details section" -> "selection expert"
I've tried with the following
{tbl_Material.Name} in ["value1", "value2", "value3"]
but it compares each record with any of these values and for e.g. returns 3 results not just 1.
Next I've tried same code using a flag value, which should be raised when one condition is met and not letting the other conditions to be compared.
numberVar flag := 0;
if (({tbl_Material.Name} = "value1") and (flag = 0)) then
(flag := 1;
{tbl_Material.Name} = "value1")
else
if (({tbl_Material.Name} = "value2") and (flag = 0)) then
(flag := 1;
{tbl_Material.Name} = "value2")
else
if (({tbl_Material.Name} = "value3") and (flag = 0)) then
(flag := 1;
{tbl_Material.Name} = "value3")
but when I define the flag in the "record selection" for each record it gets zeroed and I get the same result. May be the flag sould be defined somewhere globaly but can't figure out where and how can it be made visible for the "record selection" in this code fragment.
Glad to here other suggestions
I would be very grateful if you help solve the following problem.
I want to return only the first met value ot a range of values.
In the "details section" -> "selection expert"
I've tried with the following
{tbl_Material.Name} in ["value1", "value2", "value3"]
but it compares each record with any of these values and for e.g. returns 3 results not just 1.
Next I've tried same code using a flag value, which should be raised when one condition is met and not letting the other conditions to be compared.
numberVar flag := 0;
if (({tbl_Material.Name} = "value1") and (flag = 0)) then
(flag := 1;
{tbl_Material.Name} = "value1")
else
if (({tbl_Material.Name} = "value2") and (flag = 0)) then
(flag := 1;
{tbl_Material.Name} = "value2")
else
if (({tbl_Material.Name} = "value3") and (flag = 0)) then
(flag := 1;
{tbl_Material.Name} = "value3")
but when I define the flag in the "record selection" for each record it gets zeroed and I get the same result. May be the flag sould be defined somewhere globaly but can't figure out where and how can it be made visible for the "record selection" in this code fragment.
Glad to here other suggestions