Conditional formatting with repository variable - obiee

I am trying to conditionally format a graph with a repository variable. My goal is to end with a number between 1-12 which corresponds to the current month.
When I try,
biServer.variables['CURRENT_MONTH']
I get the following error:
Graphing engine is not responding.
"A fatal error occurred while processing the request. The server responded with: oracle.bi.nanserver.fwk.exception.BISvsException: java.lang.NumberFormatException: For input string: "2014 / 07"."
Trying the following,
RIGHT(biSerber.variables['CURRENT_MONTH'],2)
I get an error:
"A type mismatch occurred while evaluating an expression."
Finally, the follow also errors.
RIGHT('biServer.variables['CURRENT_MONTH']',2)
"The syntax of the expression to be evaluated is invalid."
Anyone have ideas? Thanks.

I ended up with a workaround that is serviceable but not ideal.
I added a new column and created a custom formula where the month number, in this case "7", is compared to the repository value CURRENT_MONTH. If CURRENT_MONTH is greater than 7, then return ".", else return "null". (The period being the least noticeable character I could think of)
From here I added the new column to the graph and set a conditional format on that column where if the value is equal to not null (a period in this instance), apply the desired conditional format.
The following link was most helpful for me.
http://bidirect.blogspot.com/2013/10/conditional-formatting-is-it-possible.html

Related

Power Automate: Create_Item Failed

I am trying to create an intake process where where a response from a Microsoft Form creates an item into our SharePoint queue for my team to work. This workflow has some branching so some questions may not always need answers. When the "Date of Change" field is used as intended in the workflow by the user, everything works correctly and appears in our queue. When the user goes down a path where the "Date of Change" field is not needed or a part of the workflow, I receive the below error and the results are never pushed to our queue.
Error Message:
The 'inputs.parameters' of workflow operation 'Create_item' of type 'OpenApiConnection' is not valid. Error details: Input parameter 'item/DateofChange' is required to be of type 'String/date'. The runtime value '""' to be converted doesn't have the expected format 'String/date'.
Workflow Images:
To fix this I have tried making the field "Not required" in hopes that if left blank it would not get read by the flow.
I have also tried, changing the format of the column from Date and time to Single Line of Text and neither of those have worked.
Try an expression instead of the dynamic content field. In this expression check for empty with the empty function. If it is empty use the null value.
Below is an example
Make sure you change the question id to your question id in the expression.
if(empty(outputs('Get_response_details')?['body/rec7e8e58aab84f49a27cacc460a7eeaf']), null, outputs('Get_response_details')?['body/rec7e8e58aab84f49a27cacc460a7eeaf'])

My flow fails for no reason: Invalid Template Language? This is what I do

Team,
Occasionally my flow fails and its enough test it manually to running again. However, I want to avoid that this error ocurrs again to stay in calm.
The error that appears is this:
Unable to process template language expressions in action 'Periodo' inputs at line '0' and column '0': 'The template language function 'split' expects its first parameter to be of type string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#split for usage details.'.
And it appears in 2 of the 4 variables that I create:
Client and Periodo
The variable Clientlooks this:
The same scenario to "Periodo".
The variables are build in the same way:
His formula:
trim(first(split(first(skip(split(outputs('Compos'),'client = '),1)),'indicator')))
His formula:
trim(first(split(first(skip(split(outputs('Compos'),'period = '),1)),'DATA_REPORT_DELIVERY')))
The same scenario to the 4 variables. 4 of them strings (numbers).
Also I attached email example where I extract the info:
CO NIV ICE REFRESCOS DE SOYA has finished successfully.CO NIV ICE REFRESCOS DE SOYA
User
binary.struggle#mail.com
Parameters
output = 7
country = 170
period = 202204012
DATA_REPORT_DELIVERY = NO
read_persistance = YES
write_persistance = YES
client = 18277
indicator_group = SALES
Could you give some help? I reach some attepmpts succeded but it fails for no apparent reason:
Thank you.
I'm not sure if you're interested but I'd do it a slightly different way. It's a little more verbose but it will work and it makes your expressions a lot simpler.
I've just taken two of your desired outputs and provided a solution for those, one being client and the other being country. You can apply the other two as need be given it's the same pattern.
If I take client for example, this is the concept.
Initialize Data
This is your string that you provided in your question.
Initialize Split Lines
This will split up your string for each new line. The expression for this step is ...
split(variables('Data'), '\n')
However, you can't just enter that expression into the editor, you need to do it and then edit in in code view and change it from \\n to \n.
Filter For 'client'
This will filter the array created from the split line step and find the item that contains the word client.
`contains(item(), 'client')`
On the other parallel branches, you'd change out the word to whatever you're searching for, e.g. country.
This should give us a single item array with a string.
Initialize 'client'
Finally, we want to extract the value on the right hand side of the equals sign. The expression for this is ...
trim(split(body('Filter_For_''client''')[0], '=')[1])
Again, just change out the body name for the other action in each case.
I need to put body('Filter_For_''client''')[0] and specify the first item in an array because the filter step returns an array. We're going to assume the length is always 1.
Result
You can see from all of that, you have the value as need be. Like I said, it's a little more verbose but (I think) easier to follow and troubleshoot if something goes wrong.

Kibana: Why i got an error of script value : aggregation_execution_exception?

I got this error:
An error occurred when loading data. Request error:
aggregation_execution_exception, Unsupported script value[0.0],
expected a number, date, or boolean in Painless script.
Here is my script field add:
def test = doc['log_data_numerical'];
return test;
I take a number and it returns a number in time format.
Here is my second log for testing the problem: second log and my first log that doesn't work and is created in live: first log.
The problem is when I try to do a Pie with some values (log_data_info1 -> weather & log_data_info2 -> car_mode) the first time i tried to do that with the first log in live but i got that : error pie.
So the problem is log_data_numerical is a string for kibana and not a number but I don't understand why because it takes just a number (0.0, 0, or some other values like 7.9293839).
I tried to do the same but with a log that I create from the first log the second log and it's work: good pie but i don't know why it's take the same values than the first log and in my script field i can change :
def test = doc['log_data_numerical'].value;
return test;
And i can save but normally that would not be possible since there are only numbers.
Edit: here is the type of
first log 1
second log 2
So please if someone knows why my log_data_numerical in my live stream log isn't considered as a number type and how to fix it I would be very grateful!
Okay, i found the problem.
It was from the logstash, i force it to being a number type and not a string.

Testing jsonpath that array contains specfic objects in any order

I'm testing a Spring controller which can give back a 400 with field errors. These field errors is an array of objects containing a "path" and "message" field.
Now I want to test that some specific call returns multiple errors with specific path and message.
I cannot come to anything closer then below:
.andExpect(jsonPath("$.fieldErrors[*].path", containsInAnyOrder("title", "description")))
.andExpect(jsonPath("$.fieldErrors[*].message", containsInAnyOrder(
"The maximum length of the description is 500 characters.",
"The maximum length of the title is 100 characters.")));
But this keeps the option open that bad combinations of "path" and "message" is accepted.
Any ideas how to improve the jsonpath to test this?
This seems to the better approach:
.andExpect(jsonPath('$.fieldErrors[?(#.path == \'title\' && #.message == \'The maximum length of the title is 100 characters.\')]').exists())
Just expanding on the answer provided by Marcel, as it helped me solve the same issue but I had to modify slightly. I found that the '&&' operator wasn't supported in the version of jsonpath we currently use in one project (0.8.1), according to this issue it was marked as 'done' on Dec 8th which implies it should be available in the latest version, 2.0:
JSON Path issue 27 - AND operators
The 'old' syntax for logical AND which I ended up using is also shown on that issue and using the example above would be:
.andExpect(jsonPath('$.fieldErrors[?(#.path == \'title\')][?(#.message == \'The maximum length of the title is 100 characters.\')]').exists())
You can use org.hamcrest.Matchers.containsInAnyOrder().
.andExpect(jsonPath("$.fieldErrors[*].path", Matchers.contains("str1", "str2")))

SQL Server Reporting Studio (SSRS) sorting error

I am attempting to allow a dynamic sort on a text box on an SSRS report. The field upon which I am trying to sort will either have an "A" or a decimal number. I am wanting to sort the decimal numbers in descending order. The expression I am using is:
=iif(isnumeric(Fields!CommScore.Value), (cdbl(Fields!CommScore.Value)*-1),6)
For the decimal number will never be larger than 5. The error I get is:
The sortexpression for the text box 'textbox74' contains an error. Input string was not in a correct format. (rsRuntimeErrorInExpression)
I imagine this is something simple. What am I doing wrong?
The error relates to the CDbl function throwing an exception when trying to convert A to a number. Yes, I know you're checking if it is numeric first but IIF is not a language construct, it is a function and as a function it evaluates all its parameters before passing them to the function. This means that both the true and false parameters get calculated even though one will be discarded.
Try the Val function. It has the benefit of not erroring when it gets passed non-numeric data - it just does the best it can to convert it.
=IIF(IsNumeric(Fields!CommScore.Value), (Val(Fields!CommScore.Value)*-1), 6)

Resources