Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Lots of countif and need a practical way

Featured Replies

Hi people. My script working slowly and any idea to speed things up appreciated.
I import records about 60000 long to a field.
And i have 60 more global fields with named as values from imported field
i wrote a looping script which gets the name of active field, match it from imported field and counts the number of matching values in the imported field.

Does that for 60 times and it get really slow. It is a commomly used script and i need a more practical way. Here is code:

 

Go to Layout [“dış veri” (Dış veriler)]

Set Error Capture [On]

Allow User Abort[Off]

Delete All Records [No dialog]

Import Records [Target:“Dış veriler”; Method:Add; Character Set:“Unicode”; Field Mapping:Source field 1 import toDış veriler:: KONUM Source field 2 import toDış veriler::IST_SUC_KODU Source field 3 import toDış veriler::FAIL_DURUMU] [No dialog]

View As [View as Table]

Go to Field [Dış veriler::İn_tic_b]

Go to Record/Request/Page [First]

Loop

Set Field[ValueCount ( FilterValues ( List ( Dış veriler 2::CASE ) ; GetFieldName(Evaluate(Get(ActiveFieldName)))))]

Go to Next Field

Exit Loop If [if ( GetFieldName(Evaluate(Get(ActiveFieldName))) = "Dış veriler::Global sabit" ;1 ; 0 )]

End Loop

Go to Layout [original layout]

 

 

Solved by Fitch

Go to solution

Interesting problem. One thing I see is that you're calling the same List function over and over again. List is generally fast, but for 60k values... it might help a little to put the list into a variable, above the Loop, and then do your FilterValues on the variable.

  • Solution

Yes, form view is worth a try, I thought about that too. Might need to update the layout to make sure all the fields are there, and the tab order is OK. But it sounds like he's just sitting on one record, moving from field to field, so I wouldn't think it would make a huge difference. Only one way to find out.

 

Freeze window would also be worth a try.

 

Another thing that might speed it a little is to not move from field to field. Instead, you could get a list of fields on the layout into a variable using the FieldNames function, and then step through that field list in your loop, using Set Field by Name.



Oh yeah, that hyperlist stuff is surprising, you'll definitely want to think about that.

 

And then there's ExecuteSQL -- it's not necessarily going to be faster, but I'd still test it.

  • Author

Found the problem. global field is a calculation field and script doesnt select this field. This means infinite loop. Is there a better way to loop through spesific fields?

  • Author

By the way using list function as a variable dropped script running time from 10 min to two seconds. Thanks for your ideas. They really helped.

1. To speed up the process first up all make sure that the layout you are using must not contain more fields than you need and no any unstored calculation field over there.

2. Need to set the layout to be view in only form view. To restrict other view you need to goto Layout setting and disable Table and List views option.

 

Layout Setup -> View -> Form View [only]

 

3. If you are using this layout in Table/List view what you can do is just duplicate the layout and did all the above settings and do all operations on that layout and then return to your original layout if you want.

 

4. Instead of using global fields and list of values into a field you can use virtual list or global variables to hold the import data.

 

Thanks,

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.