owaring Posted January 29, 2010 Posted January 29, 2010 I have a calculation "prev_st_1" field that is used in a relationship so that "st" can be calculated. because of the relationship structure that "prev_st_1" uses to calculate the first x records have no relations and thus return a ? I need this field to return a 0 if one of the referenced fields is empty, so that the other relationship can work. My current work around is to create a second calc field "prev_st_2" which looks at "prev_st_1" and if it is empty returns a 0, else returns the value. any ideas or is my work around as good as it gets?
mr_vodka Posted January 29, 2010 Posted January 29, 2010 Perhaps you can post your calc? I dont quite understand what your orig calc is even for.
owaring Posted January 29, 2010 Author Posted January 29, 2010 Let ([ n = Count(equipment_list_ST_aux::pk_equipment_list_line_id) ; all = equipment_list_ST_aux::pk_equipment_list_line_id ; prev = GetNthRecord ( all ; If (n>0;n;0) )]; prev )
mr_vodka Posted January 29, 2010 Posted January 29, 2010 (edited) Try: Let ( [ n = Count(equipment_list_ST_aux::pk_equipment_list_line_id); all = equipment_list_ST_aux::pk_equipment_list_line_id; prev = Case ( n; GetNthRecord ( all; n ); 0 ) ]; prev ) * Edit - typo and added formatting Edited January 29, 2010 by Guest Reason for edit: added closing paran and formatting
owaring Posted January 29, 2010 Author Posted January 29, 2010 perfect - with an extra ) snuck in!! : many thanks
Recommended Posts
This topic is 5470 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now