Getting expressions to work in schemas

Posted by: brain2000 on 3 August 2017, 3:59 pm EST

  • Posted 3 August 2017, 3:59 pm EST

    Greetings, I am currently evaluating ActiveAnalysis for my customers on our web application, and I have run into a few problems with the web forms.



    I am trying to right click to add attributes or measures, and when doing so, the list of fields is not available. The create attribute/measure form only shows an = sign in the expression textbox. But, let's forget this for a moment and switch to the schema editor, which does show all the fields. I would like to create a new attribute (or measure) that takes two date/times, subtracts them, and shows the number of seconds between the timespan. I've tried the following:



    =(Fields!Events__Date_Ended.Value - Fields!Events__Date_Entered.Value).TotalSeconds



    -- or --



    =DateDiff(DateInterval.Seconds, Fields!Events__Date_Entered.Value, Fields!Events__Date_Ended.Value)



    There doesn't seem to be any way to validate that I typed the expression in correctly. Also, this seems to make all columns and rows disappear when I drag in the expression. But there isn't any error message indicating what I might be doing wrong. The only thing I could find the in manual is a statement that says expression use functions in the Microsoft.VisualBasic namespace. Does this mean that I cannot use any other functions or properties, such as a timespan object?



    Please let me know what I am doing wrong.
  • Replied 3 August 2017, 3:59 pm EST

    I finally figured out the problem. The DateInterval.Seconds is NOT supported. Instead, I had to use a parameter of "s".



    So this worked:



    =DateDiff("s", Fields!Events__Date_Entered.Value, Fields!Events__Date_Ended.Value)



    Where can I find detailed documentation for expressions? It doesn't appear to be in the developer's manual.
  • Replied 3 August 2017, 3:59 pm EST

    Brain2000,

    I apologize for the inconvenience. I understand that there is no way to validate the expression written in the schema editor. I have now opened a new Case 156682 for the development team to provide a way to validate the expressions written. I have also added your E-Mail address to this case and you will be notified once a build containing this feature would be released in future.

    As far as documentation goes, the information on schema expressions can be found at this link which I think you are already aware of. I understand that this does not provide detailed explanation but once Case 156682 would be implemented, it would be relatively simple to write expressions in the schema editor.

    Regards,
    Sankalp
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels