Values from @GetNext

6 posts / 0 new
Last post
abrahma
Offline
Joined: 10/31/2015 - 04:46
Values from @GetNext

Hi Brain,
I want to extract records that satisfies my equation which has @getnext function, looks like when I perform a direct extraction I uanble to becoz of the behaviour of@ getnext funtn.
Eg. I am trying to extract invoices across records that are within 2days timeframe. I sorted my db with INV date then I created a field called check with eqn = @if(@age(@GetNextValue("INVOICE_DATE"),INVOICE_DATE) <=2,1,0)
Invoice date    Check
1/31/2006         1
1/31/2006          0      
2/28/2006         1 
3/1/2006             0
When I do a direct extraction with criteria Check == 1, the resulting db is just wrong and changes the values in the db. 
There is no way I can create a reg field and capture values in the check and then apply the criteria in the reg field. It just "Error" out.
I would like to extract all the invoices that satiefy the check condition.
Any advise in such situation.
Thanks!
Ashwini
 
 
 

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

Hi Ashwini,

Just a thought, when you perform the extraction are you also selecting the index so that the records are ordered by invoice date?  When doing an extraction IDEA defaults to no index unless you select one so this could be why you are not getting the results you expect.  If it is not that I will have to play with it a bit to see what the problem might be.

Thanks

Brian

abrahma
Offline
Joined: 10/31/2015 - 04:46

Hi Brain, last night I figured it, looks like a direct extraction with criteria doesnt work but and an extraction with no cirtiera leaves the placements of "1" in Check field as is and converts it into reg char field. After that I can apply a criteria. 
Thanks for your help. 
Ashwini

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

Hi Ashwini,

Thanks for the follow-up.  I will try it out tonight for my own curiousity because that is not how it should be working, or at least that is not how I think it should be working. 

Brian

Steven Luciani
Offline
Joined: 07/31/2012 - 13:20

To use the criteria method you discussed earlier you would need to create a regular field not a virtual field using the equation you mentioned above. If the field is virutal the outcome changes as you index and filter (apply criteria) to the file. A regular field is a once and done task. When you add it using the green check mark in the equation editor it's there and cannot be changed.

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

Hi Ashwini, I just tried it and it worked for me if for the extract I select the Database order as INVOICE_DATE/A, if I don't select it it doesn't work.

Thanks

Brian