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.
custom expression to calculate the cell value of a crosstab - TIBCO Spotfire Community

custom expression to calculate the cell value of a crosstab

Last post Fri, Apr 6 2012 3:28 PM by bokee11. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • Tue, Feb 14 2012 9:30 AM

    • Happy
    • Top 200 Contributor
    • Joined on Fri, Jan 6 2012
    • Posts 11

    custom expression to calculate the cell value of a crosstab

    Hi,

    Could you please help me write a custom expression to calculate the cell value of a crosstab or a graphical table.

     

    KPI Actual Period Previous Period
    EA 6685000 2285000
    Sales 256241.48 126241.48
    Sales Growth 0 0
    Sales vs EA 0.1 0.1
    Sales vs Target 0.14 0.14
    Target 3721000 2321000

     

    I want to calculate sales growth for Actual Period by using the following expression.

    Sales Growth: Sales for actual period -Sales for Previous Period where Sales is the KPI .

    How do i write a custom expression to get the value of Actual period for the KPI 'Sales' which is 256241.48 ?

     

    Could you please help me?

  • Sat, Mar 31 2012 6:09 PM In reply to

    Re: custom expression to calculate the cell value of a crosstab

     Try to rearrange the Cross Table then you can reference previous axis.columns or previous axis.rows inside a custom expression

    -----------------------------------
    Dr. Christof Gaenzler
    Sr Solutions Consultant
    TIBCO Spotfire
  • Wed, Apr 4 2012 3:31 PM In reply to

    • andrewchoo
    • Top 500 Contributor
    • Joined on Tue, Dec 8 2009
    • Hillsboro, OR
    • Posts 4

    Re: custom expression to calculate the cell value of a crosstab

    I'm not sure if it is even possible to perform calculations based on cell results in a cross table.

    A simple work around I've used in such situations is:

    1)  Export the cross table  - format is not important.

    2)  Add a new table in your analysis and use the exported data from step (1)

    3)  Insert a new column in the imported table with the calculation [Result] = [Actual Period] - [Previous Period]

    Hope this helps...

    Andrew Choo
    Sr. Yield Engineer
    TriQuint Semiconductor Corp
  • Thu, Apr 5 2012 5:44 PM In reply to

    Re: custom expression to calculate the cell value of a crosstab

     Before exporting you should be able to add a new table from existing and pivot the same way you have built the cross table.

    -----------------------------------
    Dr. Christof Gaenzler
    Sr Solutions Consultant
    TIBCO Spotfire
  • Fri, Apr 6 2012 3:28 PM In reply to

    • bokee11
    • Not Ranked
    • Joined on Thu, Mar 3 2011
    • Topsfield MA
    • Posts 2

    Re: custom expression to calculate the cell value of a crosstab

    no pivoting or new tables needed 

    in a crossTable  set the axes as:
    Cell Values:  Avg(if([KPI]="Sales",[Actual Period],null)) as [KPI:Sales]
    Horizontal: (Column Names)
    Vertical: (None)

    Filed under:
Page 1 of 1 (5 items)
©Copyright 2000-2011 TIBCO Software Inc | Privacy Policy | Terms of Use I Blog I Contact Us I Content Center