Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

select expert/group selection

Status
Not open for further replies.

farrelm2

Technical User
Oct 4, 2002
18
US
I am creating a report that is grouped by a variable which has 3 statuses. This is a basic report that merely lists all instances where variable j <> &quot;k&quot;.

I need a formula that will do the following:
List all instances when status=a and j<>&quot;k&quot;, and status=b, and j<> &quot;k&quot;.
For status=c, time must also=x and j<>&quot;k&quot; to list appropriate instances.

&quot;status&quot; is one database field,with 3 possible values. and i think i need to set up, in select expert, a way to filter status c for time, but not status a or b.

any help?
 
I'm not sure how you intend to set the time, is this based on a user entered parameter?

Anyway, the following should get you most of the way there, just define the time (x):

{MyTable.j} <> &quot;k&quot;
AND
(
{MyTable.status} in [&quot;a&quot;,&quot;b&quot;]
or
{MyTable.status} = &quot;c&quot;
and
{MyTable.time} = x
)

-k kai@informeddatadecisions.com
 
The above is the record selection criteria, if you want to group by these conditions (reread your post), create a formula with something like:

If
{MyTable.j} <> &quot;k&quot;
and
{MyTable.status} = 'a' then
1
else if
{MyTable.j} <> &quot;k&quot;
and
{MyTable.status} = 'b' then
2
else if
{MyTable.status} = &quot;c&quot;
and
{MyTable.j} <> &quot;k&quot;
and
{MyTable.time} = x
)
then
3
else
0

Note I place a catch all of 0

Group by this formula.

-k kai@informeddatadecisions.com
 
The time value that I need to define is a range. I am using
DateDiff(&quot;h&quot;,{cm3rm2.down_start},CurrentDate) >= -164 and
DateDiff(&quot;h&quot;,{cm3rm2.down_start},CurrentDate) <= 4

When I use this formula, from you're first reply, in record selection, I get no results:
{cm3rm1.status} <> &quot;closed&quot;
AND
(
{cm3rm1.category} in [&quot;significant&quot;,&quot;major&quot;]
or
{cm3rm1.category} = &quot;minor&quot;
and
DateDiff(&quot;h&quot;,{cm3rm2.down_start},CurrentDate) >= -164 and
DateDiff(&quot;h&quot;,{cm3rm2.down_start},CurrentDate) <= 4
)

When I put the formula from the second reply in group selection,
If
{cm3rm1.status} <> &quot;closed&quot;
and {cm3rm1.category} = &quot;major&quot; then
1
else if
{cm3rm1.status} <> &quot;closed&quot;
and
{cm3rm1.category} = &quot;significant&quot; then
2
else if
{cm3rm1.category} = &quot;minor&quot;
and
{cm3rm1.status} <> &quot;closed&quot;
and
DateDiff(&quot;h&quot;,{cm3rm2.down_start},CurrentDate) >= -164 and
DateDiff(&quot;h&quot;,{cm3rm2.down_start},CurrentDate) <= 4
then
3
else
0

I get an error &quot;The result of selection formula must be a boolean.&quot;

I want my report grouped by {cm3rm1.category}, with only {cm3rm1.category} = &quot;minor&quot; to be filtered for time.
 
I used the second post to group by. How can I hide all instances that return 0?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top