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 expressions - TIBCO Spotfire Community

custom expressions

Last post Mon, Mar 28 2011 12:47 PM by mjd. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • Wed, Mar 16 2011 6:42 PM

    • mjd
    • Top 100 Contributor
    • Joined on Wed, Jan 12 2011
    • Posts 21

    custom expressions

    Hi,

     I have a property control that allows the user to select Gross or Net; where in the expression Gross = 1 and Net = 2, (Using in a second graph).  What I would like to do is allow the user to select Net or Gross and then on a graph show the budget and actual on a combo chart, budget as a line and actual as a bar.  Here is what I have tried so far:

    case when (${AFENumberGN} = 1)
    then(sum([GROSS_ACTUALS]) as [Actuals], sum([Gross_Budget]) as [Budget] )
    else(sum([NET_ACTUALS]) as [Actuals], sum([Net_Budget]) as [Budget])
    end

     Any ideas why it is not allowing me to do this?

     Thanks!

    Michael

  • Tue, Mar 22 2011 5:04 AM In reply to

    • hvmarck
    • Top 25 Contributor
    • Joined on Tue, Dec 8 2009
    • Tibotec, Beerse, Belgium
    • Posts 103

    Re: custom expressions

    I think you'll have to split it up per column:

    if(${AFENumberGN}=1,sum([GROSS_ACTUALS]),sum([NET_ACTUALS])) as [Actuals], if(${AFENumberGN}=1,sum([Gross_Budget]),sum([Net_Budget])) as [Budget]

    Best regards,

    Herwig

  • Wed, Mar 23 2011 1:55 AM In reply to

    • mjd
    • Top 100 Contributor
    • Joined on Wed, Jan 12 2011
    • Posts 21

    Re: custom expressions

    Works like a charm! Thank you Michael
  • Wed, Mar 23 2011 3:26 PM In reply to

    • mjd
    • Top 100 Contributor
    • Joined on Wed, Jan 12 2011
    • Posts 21

    Re: custom expressions

    Ok, I have another issue.  I have a column name "Reading Type" that contains "daily" or "monthly".  I have set up a drop down box so the user can select daily or monthly, called "ReadingTProduction".  Then in another drop down box the user can select gross of net production.

     In the gross or net drop down, the expression for "Gross" is:

    if( [READING TYPE] = "${ReadingTProduction}",sum([OIL VOL ACTUAL]), null) as [Gross Oil Volume (BBL)],
    if( [READING TYPE] = "${ReadingTProduction}",sum([WATER VOLUME]), null) as [Gross Water Volume (BBL)],
    if( [READING TYPE] = "${ReadingTProduction}",sum([GAS VOL ACTUAL]), null) as [Gross Gas Volume (MCF)]

     

    I would like to display all three fluids on a line graph with time on the X axis.  However the graph is giving me the error: "Plot configuration is not valid".  Both line by and color by are selected as by "column name".  Any ideas why this isn't working?

     

    Thanks,

    Michael

  • Mon, Mar 28 2011 12:47 PM In reply to

    • mjd
    • Top 100 Contributor
    • Joined on Wed, Jan 12 2011
    • Posts 21

    Re: custom expressions

    Fixed with information links... Michael
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