Using OBIEE Presentation Variables in Column Formula - variables

I have a dashboard prompt setting a presentation variable, based on months.
I am then trying to use the presentation variable in column formulae, however I am getting the following error when I try to preview it by selecting the month of February:
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 27005] Unresolved column: "February". (HY000)
COlumn Formula :
FILTER("Fact WayLeave Movements"."WayLeave Movement" USING ("Dim Date"."Month Name" IN (#{MonthName}{'January'})))
However when I use the same variable in the analysis filter (not in the column formula, but whole analysis) it seems to run fine. But I need the presentation variable applied on particular columns and not on all of them.
Could anyone please advise how to achieve this or what I am doing wrong when using the presentation variable in the column formula.v

--Create a prompt with sql query which will fetch all month name or month number
--Assign a presentation variable to that prompt
--use that variable as a filter condition in analysis for that particular column.
So how it works is--when u select any month name from prompt that will be assigned to variable.And same month name in that variable will be used as filter condition for your column and and it will fetch data accordingly and report will run properly.
PFB a blog related to presentation Variable.
"https://blogs.oracle.com/ExalyticsOBIEE/entry/how_to_pass_presentation_variable

I assume you have setup a presentation variable already called MonthName, yo will need to add the formulae like this (#{MonthName}['#']{'January'}). in between mothname and default January.
Hope that helps.

Related

Pass a table as variable - Pentaho

I have a url: https://api.xero.com/api.xro/2.0/Reports/ProfitAndLoss?fromDate=2019-06-01&toDate=2019-06-30 which I will use after to call Xero's API.. I need to change fromDate and toDate dynamically. I thought to use https://api.xero.com/api.xro/2.0/Reports/ProfitAndLoss?fromDate=${start}&toDate=${end}. Then, add 'Data grid' with dates to be replaced in the string. But then, I tried to 'Set variables'/'Get variables' but I keep on getting the error 'Only 1 input row was expected to set the variables and at least 2 were received.' What am I doing wrong?
Current transformation:
Transformation:
Sub-job:
Final transformation:
In the set variable you can only set one row. but if you want to pass multiple rows then I suggest you to use job. In job first transformation use Data Grid and then copy rows to result. then create one more sub job. For setting variable use transformation. Make sure execute at every input row is checked. this should be your subjob Structure

How can using user defined function in custom data validation?

In my Worksheet I have a Table and want to define Data validation for a column that contained the date, as bellow:
=S2M(B2)<>"Error"
In above, S2M() is a user defined function for converting date from Persian date to Gregorian date, because checking input date is right.
But excel is not letting me use user defined functions in Custom Data validation.
This error shows: A named range you specified cannot be found.
Please note that I was using bellow code in Custom Data validation and that works, right.
=AND(LEN(B2)=10;ISNUMBER(IFERROR(VALUE(MATCH(VALUE(MID(B2;1;4));INDIRECT("intTable[Year]");0)&MATCH(MID(B2;6;2);INDIRECT("intTable[Mounth]");0)&MATCH(MID(B2;9;2);INDIRECT("intTable[Day]");0));FALSE)))
Explain is a Persian date example: 1396/05/25
Thanks.
You can do that. Select B2, or whichever cell in row 2 you want the validation to apply to. Now define a name called, say, IsValid, using:
=S2M(B2)<>"Error"
Now in the data validation box, all you need to enter is:
=IsValid
in the source box and make sure to uncheck the Ignore Blank option.

Excel VBA - Creating a Table In a Specific Non-Default(A1) Location

If you run the following code:
WorkSheet.ListObjects.add(SourceType:=xlSrcRange, Destination:=Range("A10:C13"))
One might be tempted into thinking, this would place table in the range of "A10:C13". It does not, a table is instead inserted into A1 with one column and one row(excluding the header):
This is clearly specified in the Official Documentation of this function:
The Destination argument is ignored if SourceType is set to
xlSrcRange.
How do you insert a table into any other range of cells?
You are adding your worksheet range definition into the wrong parameter.
WorkSheet.ListObjects.add SourceType:=xlSrcRange, Source:=WorkSheet.Range("A10:C13")
See ListObjects.Add Method (Excel) for a full description of the method.
Using the documentation provided from this page, I simulated what a user might do to add a table:
Range("A10:C13").Select
WorkSheet.ListObjects.add(SourceType:=xlSrcRange)
It seems adding the select statement will place the table into the correct location.

dynamic row print area excel VBA

I want to give the user the option to press "set print area" and the area printed is determined by which date they fill in.
The 2nd row always contains today's date. and then there is 2 years of data after that. Maybe the user only wants to print for first 3 months.
So the set print area code should be written something like.
row = len(date max - len today)
I am very new to VBA, so have no clue how to write this.
thank you!
I'm not sure why you want to use VBA to do this when you can just use 'Filter' on the data you have. On the date column you can then use the in-built 'Date Filters' to filter out any range of data. Once you specify the filter, print command will only print the filtered data set and not the complete data set.
Anyways if you want the row it can also be achieved via Excel Formula:
=ADDRESS([dataset_first_row]+MATCH([set_print_area_date_cell],[dataset_date_range],-1)-1,2,4,1)

Search for distinct word DAX formula

I am trying to create a columns which looks at another column called software name, if this column contains a certain word the new column will say what it is. so for example chrome is found in the software column, in the new column this will say Google and then if the software column contains firefox, the new column will have mozilla. Ive tried using the contain and search function and i come out with #ERROR all the time.
Anyone got a solution??
Pseudo code
=IF(CONTAINS([softwareName],"Chrome"),"Google", IF(CONTAINS([softwareName],"Firefox"),"Mozilla","Unknown"))
This should work:
=IF(IFERROR(SEARCH("Chrome",[SoftwareName]),-1) <> -1, "Google",IF(IFERROR(SEARCH("Firefox",[SoftwareName]),-1)<>-1,"Mozilla", "Unknown"))
The Search function in DAX actually returns an error if it cannot find the string you provided. Otherwise it returns the starting position where the string can be found. See the DAX reference for more details. So I used iferror to catch the error returned when it can't find the string. If it doesn't find the string (and therefore Search returns an error) , it returns -1 instead, which cannot possibly be a valid start position in this context. If the search for "Chrome" is not -1, "Chrome" was found so the value is "Google". Otherwise, it moves on to the next if statement.