Adding ranges to a view to only include if a field is 15 characters in length

  • Adding ranges to a view to only include if a field is 15 characters in length

    Posted by Patricia on June 6, 2018 at 7:32 pm
    • Patricia Allen

      Member

      June 6, 2018 at 7:32 PM

      ?I am trying to create a view that uses the dimensionattributevaluecombination table as the primary datasource, but only include the records where theĀ  length of the displayvalueĀ  field inĀ theĀ  dimensionattributevaluecombination Ā tableĀ 15 characters long.
      I would appreciate help.

      ——————————
      Patricia Allen
      County Auditor
      Walker County Texas
      Huntsville TX
      ——————————

    • Mark Prouty

      Member

      June 7, 2018 at 9:19 AM

      ?Can you use 15 question marks: ???????????????Ā  ?

      ——————————
      Mark Prouty
      Programmer / Analyst
      ANGI Energy Systems
      Janesville WI
      ——————————
      ——————————————-

    • Patricia Allen

      Member

      June 8, 2018 at 11:16 AM

      ?That worked.Ā  Thanks

      ——————————
      Patricia Allen
      County Auditor
      Walker County Texas
      Huntsville TX
      ——————————
      ——————————————-

    • Rick Pierson

      Member

      June 8, 2018 at 9:21 AM

      You could try the following (use at your own risk, test this out in DEV before touching TEST or PROD, blah blah blah).

      1) Create a new custom table to store the length of the DisplayValue.
      Name the table something like AaaDAVCExtension (where Aaa is a 3-letter code for your company).
      The new table would (at this point) have only 2 fields: RefRecId and DisplayValueLength

      2) Use eventing on the DimensionAttributeValueCombination table’s insert method to call code that populates AaaDAVCExtension fields DisplayValueLength and RefRecId.
      Test the eventing code to make sure it works.

      3) Write a one-time-use AX job to while select through DimensionAttributeValueCombination and store the length of DisplayValue in the new table.Ā  Run the job over night and check results.

      4)Ā Relate the new table back to DimensionAttributeValueCombination using an exactly 1-to-exactly 1 “relation”.Ā  Ā 
      So newTable.RefRecId = DimensionAttributeValueCombination.RecId

      5) Modify the view to include the new table, inner joined to DimensionAttributeValueCombination.

      If you do the above, then adding a query range (on the new table) would be easy and should be far more performant than calculating the length of each DimensionAttributeValueCombination record’s DisplayValue on the fly for each execution of the view.

      ——————————
      Rick Pierson
      Braun Intertec
      Bloomington MN
      ——————————
      ——————————————-

    Patricia replied 7 years, 3 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

The discussion ‘Adding ranges to a view to only include if a field is 15 characters in length’ is closed to new replies.

Start of Discussion
0 of 0 replies June 2018
Now

Welcome to our new site!

Here you will find a wealth of information created for peopleĀ  that are on a mission to redefine business models with cloud techinologies, AI, automation, low code / no code applications, data, security & more to compete in the Acceleration Economy!