That's probably calculated a lot easier in the script instead of as a (slow) calculated dimension. Can you post a document with some sample data? See this document for how to do that safely: Preparing examples for Upload - Reduction and Data Scrambling