Categories
- All Categories
- 15 Oracle Analytics Sharing Center
- 14 Oracle Analytics Lounge
- 214 Oracle Analytics News
- 42 Oracle Analytics Videos
- 15.7K Oracle Analytics Forums
- 6.1K Oracle Analytics Idea Labs
- Oracle Analytics User Groups
- 78 Oracle Analytics Trainings
- 14 Oracle Analytics Data Visualizations Challenge
- Find Partners
- For Partners
Formatting Calculated Items

I'm working on an analysis where I have a pivot table that looks at Total Award by Institution, by year, and ranks the institutions by Total Award. The general format is:
2018 | 2017 | |||
---|---|---|---|---|
Institution | Total Award | Rank | Total Award | Rank |
Cool Biscuit University | 1,000,000 | 1 | 950,000 | 2 |
Excellent Soup College of Broth | 900,000 | 2 | 975,000 | 1 |
Great Taste Academy | 550,000 | 3 | 600,000 | 3 |
The Rank is calculated using RANK(Fact.Total Award). I've created a calculated item to show the percent change in Total Award between the two years. I used conditional formatting so my percent change shows as a percent--that works just fine. The issue I'm having is that it's also giving me a percent change for the Rank, which I do not want. I've tried conditional formatting on Rank where if the year is Null, CSS display is none. This gets rid of the values in the percent change column for Rank, but the header is still there. And of course, if I exclude Rank, then it doesn't display in the table at all. I am using 12c.
Is there a way to do conditional formatting on the headings in a table? Anyone have any tips?
Thanks in advance!
Answers
-
I can't solve the problem using your initial approach, but if you pivot the data by year in your criteria window, you can do a Pct. Change column and a RANK(Total Award by Year) column.
Create a 2017 column using a formula filter like: FILTER("Tablename"."Total Award" USING ("Tablename"."Year" = 2017)). Do the same for 2018, then you can create calculated column for pct change.0 -
So I didn't want to mark this correct until I was actually able to achieve my goal.
Part of the functionality the stakeholders want is the ability to change the time period that's being looked at. This can be achieved with your method by referencing the presentation variable, @{pv_ffy_in}, in both the column formula and the column heading, the latter of which I wasn't sure would actually work. For the prior years, the reference is @{pv_ffy_in -n}. This solution can probably be applied in other situations where the unfriendly nature of calculated items leads to formatting problems.
Thank you for the insight!
0 -
Glad I could help. I've found that I can reference repository variables in the headings, but not presentation variables. One way around that is to create a narrative view. If you include the values of your variables as columns, you can list them in the prefix, then list each record in the body. Formatting is a bear, though. Another (beastly) way to do it is to create row of headings in a union query. You can reference your variables in each column, but all of your other work has to be cast as char.
Cheers!
0 -
The formatting for the narrative view isn't too bad as long as you avoid HTML markup. If you're referencing more than a couple columns in the narrative view and you're using HTML markup, it causes the PDF export to sometimes move the table over to the right. In my case, I have up to 8 column references in some of these titles (yes--this is ridiculous), so I had the same report exporting both left-aligned (with one set of prompt selections), and appearing to be centered (with a different set of prompt selections). Oracle considers the HTML markup to be outside of their support scope, so it's not something that they're explicitly working on fixing. However, using the built-in formatting in the narrative view instead of HTML markup works, at least most of the time. I had one scenario where, to avoid HTML, I had to remove certain filters and columns so I could actually see the results in the analysis editor in order to fix the alignment of a narrative view I was using for a footnote, since that alignment is accessed through the [XYZ] button, and as far as I can tell, nowhere else. In this situation, HTML markup is the much less tedious route, as long as there aren't too many column references. This particular footnote only has one, so both approaches work.
0 -
Sounds like tough sledding, but well done. I did format with html when I used this narrative-view method, but I wasn't concerned with the export difficulties.
0 -
Sounds like tough sledding, but well done. I did format with html when I used this narrative-view method, but I wasn't concerned with the export difficulties.
0