Previous not giving correct results

Hi,

I have a table with 14 fields and I am trying to add an identifier based upon one field.

However, it is not giving the expected results when used as a variable in the table.

If I cut down the number of columns to just include the field I wish to check for being unique, it works.

However, this is of little use as I need to run this with all the fields included.

Is there something that I am not aware of when using the following as the definition for the variable ?

= If <AP Patient Number(Query 2 with telcare1)>=Previous(<AP Patient Number(Query 2 with telcare1)>) Then 0 Else 1

Spreadsheet with actual report data attached.

Thanks in advance for any pointers.

Chris Swann
Unique.xls (30.0 KB)


dc8 :uk: (BOB member since 2009-07-10)

I’m not sure I understand the question. The data you posted in Excel is doing exactly what I would expect it to do. Are you saying the data in the sheet you posted is wrong?

What would help, perhaps, is to post your sheet with the actual result and then a new column next to it showing the desired result.


Dave Rathbun :us: (BOB member since 2002-06-06)

Dave,

Looking at just this small part of the data

1 CS0001
0 CS0001
0 CS0001
0 CS0001
0 CS0001
0 CS0001
0 CS0002
0 CS0002
0 CS0003
0 CS0003

Why does CS0002 not show a 1 and CS0003 the same ?

Chris


dc8 :uk: (BOB member since 2009-07-10)

Ah, didn’t see that part. I just looked at the top part which looked fine.

Question: does the data in this block come from merged data providers? Or just one?


Dave Rathbun :us: (BOB member since 2002-06-06)

Dave,

The data comes from 2 providers.

It has to be done this way to include those records which don’t have a value in the DerivedPCT field.

I guess this is what is causing the problem.

Chris


dc8 :uk: (BOB member since 2009-07-10)

I suspected that…

Can you confirm that the rows where the previous fails are rows where the data is missing from the data provider that you reference? What I mean by that, is, you reference “Query 2” in your formula. Try switching it to “Query 1” and see if the logic fails in the same place, or different places. If I am correct, I would guess that it will fail in different spots. If you can check that, I will keep thinking about a way to fix it. :slight_smile:


Dave Rathbun :us: (BOB member since 2002-06-06)

Hi Dave,

This is the result of changing to Query 1

1 CS0001
1 CS0001
1 CS0001
1 CS0001
1 CS0001
1 CS0001
1 CS0002
1 CS0002
1 CS0003
1 CS0003

I guess that confirms its the data providers causing the error.

Chris


dc8 :uk: (BOB member since 2009-07-10)

Ok, then I have some ideas, but I need to test first. :slight_smile:


Dave Rathbun :us: (BOB member since 2002-06-06)

Hi Dave,

Any luck on the tests or do I just give this one up as yet another thing BO is incapable of doing ?

C


dc8 :uk: (BOB member since 2009-07-10)

Haven’t had time… had a cub scout camping trip this weekend to first prepare for and then experience. I’m still stiff and sore. :slight_smile:


Dave Rathbun :us: (BOB member since 2002-06-06)