cancel
Showing results for 
Search instead for 
Did you mean: 

Cube View Parametric driven column

FM
New Contributor III

I have a cube view that I need to modify so that in the second column we are getting data that is driven by the selection that the user makes for the first column.

For example if the user selects a forecast for February to be in the first column, then the second column of the cube view would have to be the previous month’s forecast.

Do you have any suggestions on how to achieve this view?

Thank you in advance for any help and suggestions!


I am going to attach some views of what I have in here so far (The second column reads OP plan as I have copied this view from another similar Cube View).

FM_0-1659641859661.png

 

FM_1-1659641859662.png

 

FM_2-1659641859663.png

 

 

FM_3-1659641859664.png

 

2 ACCEPTED SOLUTIONS

LeAnnTDang
New Contributor II

Our consultant showed me to use Text attribute for scenario to get prior forecast. So in Jan_FCST, if you assign Text1 attribute as Feb_FCST, then in your OP filter, you can retrieve S#Fcsts.base.Where(Text1 = |!param_FCST!|). This setup allow when users select Feb_FCST for Forecast column, OP column will retrieve S#Fcsts.base.Where(Text1 = Feb_FCST) which would be Jan_FCST). 

This works for cube view, but our users want to use this setup for quick view. However I don't know of a way to make parameter prompt in quick view. If anyone has any tips to apply this for quick view, please advise. Thank you!

View solution in original post

t_kaplanis
New Contributor II

I agree with @aricgresko on perhaps using an XFBR business rule. The below code could be optimized in many ways, but should work for what you need. This way you do not need to use/manage any text values.

"YourRuleNameHere" will equal what you named your XFBR business rule, ensure whatever you named it matches the XFBR call you place in the cube view.

XFBR Cube View Line Call (What you would put on your cube view line instead of "S#|!param_FCST!|"):

XFBR(YourRuleNameHere, GetPriorFcst, CurrentFcst=|!param_FCST!|)

Create an XFBR Business Rule and paste in the following code:

Imports System
Imports System.Data
Imports System.Data.Common
Imports System.IO
Imports System.Collections.Generic
Imports System.Globalization
Imports System.Linq
Imports Microsoft.VisualBasic
Imports System.Windows.Forms
Imports OneStream.Shared.Common
Imports OneStream.Shared.Wcf
Imports OneStream.Shared.Engine
Imports OneStream.Shared.Database
Imports OneStream.Stage.Engine
Imports OneStream.Stage.Database
Imports OneStream.Finance.Engine
Imports OneStream.Finance.Database

Namespace OneStream.BusinessRule.DashboardStringFunction.YourRuleNameHere   '<--------- NEED TO CHANGE "YourRuleNameHere" AND ADD TO XFBR CALL WITHIN CUBE VIEW
	Public Class MainClass
		Public Function Main(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Object, ByVal args As DashboardStringFunctionArgs) As Object
			Try
				If args.FunctionName.XFEqualsIgnoreCase("GetPriorFcst") Then
						Dim CurrFcst As String = args.NameValuePairs("CurrentFcst")
				   	    Dim PriorFcst As String = String.Empty
					
						Select Case CurrFcst
							Case "Jan_FCST"
								PriorFcst = "Dec_FCST"
							Case "Feb_FCST"
								PriorFcst = "Jan_FCST"
							Case "Mar_FCST"
								PriorFcst = "Feb_FCST"
							Case "Apr_FCST"
								PriorFcst = "Mar_FCST"
							Case "May_FCST"
								PriorFcst = "Apr_FCST"
							Case "Jun_FCST"
								PriorFcst = "May_FCST"
							Case "Jul_FCST"
								PriorFcst = "Jun_FCST"
							Case "Aug_FCST"
								PriorFcst = "Jul_FCST"
							Case "Sep_FCST"
								PriorFcst = "Aug_FCST"
							Case "Oct_FCST"
								PriorFcst = "Sep_FCST"
							Case "Nov_FCST"
								PriorFcst = "Oct_FCST"
							Case "Dec_FCST"
								PriorFcst = "Nov_FCST"						
						End Select

					Return "S#" & PriorFcst

				End If

				Return Nothing
			Catch ex As Exception
				Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
			End Try
		End Function
	End Class
End Namespace

 

View solution in original post

8 REPLIES 8

LeAnnTDang
New Contributor II

Our consultant showed me to use Text attribute for scenario to get prior forecast. So in Jan_FCST, if you assign Text1 attribute as Feb_FCST, then in your OP filter, you can retrieve S#Fcsts.base.Where(Text1 = |!param_FCST!|). This setup allow when users select Feb_FCST for Forecast column, OP column will retrieve S#Fcsts.base.Where(Text1 = Feb_FCST) which would be Jan_FCST). 

This works for cube view, but our users want to use this setup for quick view. However I don't know of a way to make parameter prompt in quick view. If anyone has any tips to apply this for quick view, please advise. Thank you!

aricgresko
Contributor

For cube views, you could write an XFBR to derive the prior forecast based on the forecast that was selected via parameter.  For quick views, I would recommend setting up some literal parameters.  This would be something the admin would maintain, but it's very easy and only a once a month update.

Example of how you could setup these literal parameters:

|!CurrFcstScenario!| = Feb_FCST

|!PriorFcstScenario!| = Jan_FCST 

Then you teach the users how to use the above two literal value parameters in their quick views and XFGetCell's to automate the correct forecast scenarios.  

SRichards
New Contributor III

I would agree with the XFBR approach, this will give you the most flexibility in what you want to display based on the users selection in the scenario parameter.

Our users would like to manage the selection in Prior Fcst Scenario by themselves, because they could be selecting prior month, prior quarter, etc... They have multiple quick views on a spreadsheet and would like one scenario selection to apply to all quick views, rather than going to each quick view and update scenario. Do you have suggestions on how to make that work? 

I'm pretty sure there isn't a way to update multiple quick views simultaneously.  You'd only be able to accomplish this with XFGetCell. 

Thank you Aric. I ended up setting up an XFBR like as suggested in this chain and use a literal parameter to set up the XFBR

S#XFBR(BusinessRuleName, FunctionName, NameValuePair=|POVScenario|), so the main POVscenario would be the driver for prior forecast. 

That seems to work for now.  Thanks again for your help. 

t_kaplanis
New Contributor II

I agree with @aricgresko on perhaps using an XFBR business rule. The below code could be optimized in many ways, but should work for what you need. This way you do not need to use/manage any text values.

"YourRuleNameHere" will equal what you named your XFBR business rule, ensure whatever you named it matches the XFBR call you place in the cube view.

XFBR Cube View Line Call (What you would put on your cube view line instead of "S#|!param_FCST!|"):

XFBR(YourRuleNameHere, GetPriorFcst, CurrentFcst=|!param_FCST!|)

Create an XFBR Business Rule and paste in the following code:

Imports System
Imports System.Data
Imports System.Data.Common
Imports System.IO
Imports System.Collections.Generic
Imports System.Globalization
Imports System.Linq
Imports Microsoft.VisualBasic
Imports System.Windows.Forms
Imports OneStream.Shared.Common
Imports OneStream.Shared.Wcf
Imports OneStream.Shared.Engine
Imports OneStream.Shared.Database
Imports OneStream.Stage.Engine
Imports OneStream.Stage.Database
Imports OneStream.Finance.Engine
Imports OneStream.Finance.Database

Namespace OneStream.BusinessRule.DashboardStringFunction.YourRuleNameHere   '<--------- NEED TO CHANGE "YourRuleNameHere" AND ADD TO XFBR CALL WITHIN CUBE VIEW
	Public Class MainClass
		Public Function Main(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Object, ByVal args As DashboardStringFunctionArgs) As Object
			Try
				If args.FunctionName.XFEqualsIgnoreCase("GetPriorFcst") Then
						Dim CurrFcst As String = args.NameValuePairs("CurrentFcst")
				   	    Dim PriorFcst As String = String.Empty
					
						Select Case CurrFcst
							Case "Jan_FCST"
								PriorFcst = "Dec_FCST"
							Case "Feb_FCST"
								PriorFcst = "Jan_FCST"
							Case "Mar_FCST"
								PriorFcst = "Feb_FCST"
							Case "Apr_FCST"
								PriorFcst = "Mar_FCST"
							Case "May_FCST"
								PriorFcst = "Apr_FCST"
							Case "Jun_FCST"
								PriorFcst = "May_FCST"
							Case "Jul_FCST"
								PriorFcst = "Jun_FCST"
							Case "Aug_FCST"
								PriorFcst = "Jul_FCST"
							Case "Sep_FCST"
								PriorFcst = "Aug_FCST"
							Case "Oct_FCST"
								PriorFcst = "Sep_FCST"
							Case "Nov_FCST"
								PriorFcst = "Oct_FCST"
							Case "Dec_FCST"
								PriorFcst = "Nov_FCST"						
						End Select

					Return "S#" & PriorFcst

				End If

				Return Nothing
			Catch ex As Exception
				Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
			End Try
		End Function
	End Class
End Namespace

 

FM
New Contributor III

Thank you very much to everyone that commented in here.

t_kaplanis I ended up using your solution and modifying the business rule slightly. I appreciate the input. Thank you very much