Oracle Analytics Cloud and Server

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

How to add a value to a presentation variable in a column header?

Received Response
382
Views
10
Comments
Bouman, Arie
Bouman, Arie Rank 3 - Community Apprentice

Hi all,

I'm trying to add a value to a given presentation variable and have it shown in the column heading but it looks like BI is concatenating instead of adding. All other mathematical functions seems to function as expected.

Example, I am using a PVYearnr giving a current year, e.g. 2020

If I diminish '1' like @{PVYearnr-1} my result reads 2019

If I divide by '2' like @{PVYearnr/2} my result reads 1010

BUT if I add '1' like @{PVYearnr+1} or @{PVYearnr}+1 my result reads 20201 or 2020+1

pastedImage_0.png

Has somebody faced this problem earlier or do you know how to solve this issue?

Thanking in advance,

Arie

Answers

  • [Deleted User]
    [Deleted User] Rank 2 - Community Beginner

    Counter-question:

    Any reason that you aren't using timeseries functions for this? I know the reply will be "this is a requirement", but pretty much hacking a column header instead of using out-of-the-box functionality is a bit questionable in terms of profitable use of a product that you're paying for

  • Jerry Casey
    Jerry Casey Rank 6 - Analytics Lead

    Hi Arie, I struggled with this same issue a few years ago, back in 11.1.9, but it sounds like it's still a problem.  My solution was kind of hacky, but it worked.

    in the columns below, "STIPYear1" is a presentation variable set by a dashboard prompt:

    pastedImage_0.png

    In the dashboard properties, I placed a hidden prompt that used the value of "STIPYear1" to calculate values of "varSTIPYear2", "varSTIPYear3", and "varSTIPYear4".

    pastedImage_1.pngpastedImage_2.png

    This may be ugly, but it works:

    pastedImage_3.png

    Good luck,

    Jerry

  • [Deleted User]
    [Deleted User] Rank 2 - Community Beginner

    Damnit Jerry x-D

  • Jerry Casey
    Jerry Casey Rank 6 - Analytics Lead

    I just saw Christian's post, and I don't disagree.  In my case, the columns for future years were all calculated based on various project schedule and financial attributes.

    I should also add that I used a two-page dashboard prompt.  This requires the user to hit "Apply" before completing the second page of the prompt.

    Page 1:pastedImage_1.pngPage 2:pastedImage_2.png

  • Jerry Casey
    Jerry Casey Rank 6 - Analytics Lead

    I'm the little devil on their left shoulder.

  • Bouman, Arie
    Bouman, Arie Rank 3 - Community Apprentice

    Hi Christian, thank you for your counter-question, you mean something like Timestampadd(TSI_SQL_Year, 1, @PVYearnr)?

    It didn't work because of different data-types. The result from @PVYearnr is a number instead of a date-serie. Maybe I should rebuild all to a 'real' date-format?

  • Bouman, Arie
    Bouman, Arie Rank 3 - Community Apprentice

    Hi Jerry,

    Thanks for
    your extensive reply. Reading this I remembered that I did something similar with months but then I was deducting numbers. I am going to figure out if it works when adding numbers.

  • [Deleted User]
    [Deleted User] Rank 2 - Community Beginner

    Don't think I don't do the exact same thing myself sometimes Do as I say...not as I do.

  • Bouman, Arie
    Bouman, Arie Rank 3 - Community Apprentice

    Hi Jerry, I used your advice and my earlier solution, and it works fine.

    Thanks.

  • [Deleted User]
    [Deleted User] Rank 2 - Community Beginner

    In that case can you please close this thread so that other forum users will benefit from this thread as well? Thanks.