cancel
Showing results for 
Search instead for 
Did you mean: 

Select Expert

Former Member
0 Kudos

Post Author: waterboy550

CA Forum: General

I have made a report using one data source. This data source is a txt file with many different rows and columns. I have used formula fields to break each row of numbers into its own field. Here is my problem. About half of the rows have 0s in random places. I would like to get rid of these 0s and move the numbers up to fill in for the missing 0s. ExampleOriginal data What I want Selection expert (because there where 0s in the second row at column 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 and 4 the whole column gets2 0 2 0 2 2 2 0 2 3 2 3 2 2 2 3 0 3 3 3 3 3 0 3 removed and not just the 0 3 3 3 3 3 0 3 4 3 4 3 3 individual number)4 0 4 4 4 0 0 0 4 4

I've tried to use select expert, but if i say skip all values in row 2 that are 0s, then this will take away that column from all the rows of numbers, not just that row.

does anyone know anyway to do this?

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Post Author: synapsevampire

CA Forum: General

SInce the solution requires knowing what's in the fields, and you're interested in displaying code that doesn't work instead, plsu referencing @Test (which we've no idea what's in there), I can't help you.

If you'd like to provide sample data (show the columns involved) and the expected output, I'll give it a shot.

-k

Former Member
0 Kudos

Post Author: waterboy550

CA Forum: General

Local BooleanVar run = false;Local StringVar cur = {@Test};Local StringVar curNext;

//Checks if there is another data entry While run = false do curNext = Next({@Test});

//Switches cur with curNext if cur = 0 If cur = '0.00' Then cur = curNext;

If NextIsNull({@Test}) Then run = true;

This is the code I'm trying to use. I'm not used to coding in Crystal Reports, but I do have a lot of experience with Java coding. When I enter this code I recieve an error message that says the loop will be evaluated more then the allowed times. What the code is suposed to do is look at another formula field that is a row of numbers. Some of the numbers are zeros. I'm trying to code a formula field that checks if variable cur is 0.00 then if it is replaces this value with the next value. What should I do to improve this code?

Former Member
0 Kudos

Post Author: synapsevampire

CA Forum: General

Different rows and columns looks like one column in your example.

Anyway, you can build out a string from the columns which drops zeros, but I'd need specifics to show you how.

Example data generally includes the columns and the data in each so that one can code accordingly, not just an example of what a report might look like if all fields were on there.

Can't really code without undersatanding the columns involved.

-k