The Spotfire Community is moving to TIBCOmmunity and this forum location has closed. During the transition, you can still search the old forums but posting has been disabled. We encourage you to pick up the discussion at the new Spotfire community on TIBCOmmunity.
Calculating Error Bars - TIBCO Spotfire Community

Calculating Error Bars

Last post Tue, Feb 19 2013 11:15 PM by jfrunzke. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • Fri, Feb 15 2013 8:38 AM

    Calculating Error Bars

    I would like to generate a bar chart showing the average of one criterion as bar height and the maximum of the same criterion as the upper error bar.

    The problem is calculating the upper error bar value. Setting it to max(<criterion>)-avg(criterion) is simple enough, but I want the flexibility to select the criterion into a document property.

    Replacing the criterion in the formula with the document property gives an error. Neither 

    Max(DocumentProperty("PropertySel"))-Avg(DocumentProperty("PropertySel"))

    (as proposed by the expression designer) nor

    Max(${PropertySel})-Avg(${PropertySel})

    (the usual syntax for accessing document properties in formulas) works. I see no logical reason why it shouldn't work.

    Any ideas?

     

    Best wishes

     

      JF

     

  • Fri, Feb 15 2013 11:25 AM In reply to

    • Ryan Weber
    • Top 10 Contributor
    • Joined on Thu, Jun 7 2012
    • Oklahoma City, OKC
    • Posts 186

    Re: Calculating Error Bars

    Is PropertySel populated by a column name? If you want to reference a property control as a column name, you need to wrap it in brackets like so Max([${PropertySel})
    Hope that helps!

    Thanks,
    Ryan
  • Sat, Feb 16 2013 2:47 AM In reply to

    Re: Calculating Error Bars

    Hi Ryan,

     Thanks for the answer.

    You are correct, the property is populated by a column name, but the error message in this case is "Preprocessor syntax is not supported".

    Jan

  • Tue, Feb 19 2013 6:42 AM In reply to

    • Ryan Weber
    • Top 10 Contributor
    • Joined on Thu, Jun 7 2012
    • Oklahoma City, OKC
    • Posts 186

    Re: Calculating Error Bars

    Hi Jan, Can you get either of the individual expressions to work? Could it possibly be that your property name is using some sort of reserved name or character that would need to be escaped? Maybe the column types don't match the expected data type? Just throwing out some ideas.
    Hope that helps!

    Thanks,
    Ryan
  • Tue, Feb 19 2013 7:09 AM In reply to

    Re: Calculating Error Bars

     Hi Ryan,

     Thanks for the suggestions. My document property is actually called "PropertySel" and the column types are integer. Nothing wrong with that.

    Did you try it yourself once?

    Quite simple, takes five minutes. Here is a list of data, generate a bar chart category vs. avg(value). Put a drop-down list into a text area that selects column names. Then try to calculate the upper error as max([${Property}]). If you get the same, I would open a service request with Tibco.

     

    ID Kategory Value
    1 A 85
    2 B 66
    3 C 15
    4 A 91
    5 B 63
    6 C 13
    7 A 16
    8 B 24
    9 C 65
    10 A 53
    11 B 32
    12 C 2
    13 A 40
    14 B 9
    15 C 76
    16 A 80
    17 B 80
    18 C 66
    19 A 29
    20 B 12
    21 C 56
    22 A 98
    23 B 84
    24 C 84
    25 A 33
    26 B 22
    27 C 87
    28 A 51
    29 B 38
    30 C 97
    31 A 14
    32 B 91
    33 C 4
    34 A 99
    35 B 8
    36 C 73

     

  • Tue, Feb 19 2013 7:14 AM In reply to

    • Ryan Weber
    • Top 10 Contributor
    • Joined on Thu, Jun 7 2012
    • Oklahoma City, OKC
    • Posts 186

    Re: Calculating Error Bars

    I have successfully done this before, and I double checked that it still worked before I posted with my own data. Are you saying that the data type of the property control is an integer? That would definitely be an issue, since you want to feed it column names which would be of type string. Also, if that isn't your issue, you might try naming your property control something other than "property".
    Hope that helps!

    Thanks,
    Ryan
  • Tue, Feb 19 2013 11:15 PM In reply to

    Re: Calculating Error Bars

    Hi Ryan,

     I tried again and named the property control "testprop" this time. The property itself is of type string, but the column values are of type ineger so that it is not the issue that no avg() can be calculated.

    I will open a support case with Tibco, maybe they have an idea.

    Thanks a lot for your suggestions!

    Jan

Page 1 of 1 (7 items)
┬ęCopyright 2000-2011 TIBCO Software Inc | Privacy Policy | Terms of Use I Blog I Contact Us I Content Center