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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Only Select certain rows 1

Status
Not open for further replies.

Cpreston

MIS
Mar 4, 2015
972
GB
Hi

I have a report that is grouped by orderlines.

The orders may have up to 6 rows or mote. However, I want to create 2 sperate reports.

One report that only shows the first 2 rows of the orderlines and hide the rest
The other report to only show the 3rd and fourth row of the orederlines and hide the rest

Not sure if this is possible, could someone please advise.

Thanks
 
Sorry my issue as changed since the first post.

I managed to add in distinct row numbers which worked. However I now need to include a Line type which is named Source, Process and Finished.

I need to show the rows with
Line Type Source and Finished and only the first 2 rows of Process in one report
AND
Line Type Source and Finished and only the first 3rd and 4th rows of Process in the other report

I still have the line numbers I created , I tried this but my syntax is not so good, this shows everything. I put the syntex in a group for orderline and then suppress it but I think I am losing my way

IF {@FormattedLineType} = 'Source' AND {@FormattedLineType} = 'Finished' AND {#Row No} = 2 AND {#Row No} = 3
Then True
ELSE False

Any ideas please. Thanks in advance
 
Maybe something like this.

({@FormattedLineType} = 'Source' OR {@FormattedLineType} = 'Finished')
OR
({@FormattedLineType} = 'Finished' AND ({#Row No} = 1 OR {#Row No} = 2))
 
Thanks for the reply I ended up with this code with No Suppress

If {#Row No} <> 1 and {#Row No} <> 2 and {#Row No} <> 3 AND {@FormattedLineType} = 'Process' THEN True

Thanks
 
You are supressing rows, which is a very bad idea. Supressed rows are still part of the report and will be included in any subtotals or grand totals of the report.

You need to exclude these records from your report entirely with a record selection formula.

Macola and Sage 50/Sage 100 Consultant

Check out our Macola tools:
 
Well my doe worked for a short period however using Running Total field with a distinct count Product Code and on change of field set to WO Number.

I have 3 types of lines
Source
Process
Finished

The source was keeping everything at number 1 in the total field, 2,3,4,5 for the process and 6 for finished.

We just came across if the Product Code changes but is on the same WO number it set the Source to 1 and 2 (my guess is it would be 3 if it changed again on the same WO number).

So for this report I only wanted to view Process where the running total was 2 and 3 and I used the code as below

If {#Row No} <> 1 and {#Row No} <> 2 and {#Row No} <> 3 AND {@FormattedLineType} = 'Process' THEN True

This worked perfect until the Source became 1 and 2.

I cannot figure out a way to make

Source to always = 1
Process to always start at 2 then 3 then 4 then 5 (there is usually 4 processes)
Finished = 6

I only want to show the 2 and 3 process in the report.

Any ideas please would be great.

Thanks
 
Another idea which may make if simple or not, I could create a forumla that does as below for Source and Finished = 6, however how do I get it it to number the Source from 2 to 5 starting in the order they list in.

If {@FormattedLineType} = 'Source' then 1
If {@FormattedLineType} = 'Process' then ??????
If {@FormattedLineType} = 'Finished' then 6

Any ideas please.

Thanks
 
Hi

I managed to get it working.

I did the numbering for the Type
The I did a Running Total count on only the Process which gave me the number 1,2,3,4,5
I then suppressed the Group other than 1 and 2

Long winded maybe but it worked.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top