Pentaho Report Design conditions - pentaho

I want to put one condition for the columns in the report. I am passing a parameter called "TEMPLATE", I want to make some of the columns in report visible only if the values of passed parameter lies IN ["A","B",C","D"]. I am putting it like:
=IF([TEMPLATE]IN("A";"B";"C";"D";"E");TRUE();FALSE());
But it says syntax error every time and doesn't work. Can someone please help me in making it correct.

This is the correct syntax:
=IF(IN([TEMPLATE];"a";"b";"c");TRUE();FALSE())
where is
IN(<condition>;<sample1>;<sample2>;...)
returns true if <condition> equals to one of the <sampleX>. Otherwise return false.

Related

AnyLogic - Why does my condition based transition not work?

I have a question related to a transition in my statechart (see image above). I have a variable called palletInUse which is a boolean-type and changes between true and false. For one transition in my statechart I want it to change when the variable palletInUse has the value true. I have tried it with for example:
palletInUse == true;
and also tried different code like, equals and contentEquals etc. but nothing seems to work. Do you have a solution for this, seemingly simple problem?
Thanks in advance
The condition is not monitored constantly, only when something is changed in the agent. When you assign a new value to variable with common "=" Java operator, it is not caught by the AnyLogic engine. You need to call onChange() function after that. Then, the transition should be executed.
There are other ways to trigger the condition check without explicit onChange() call. You may find them in AnyLogic Help article.
BTW, you may specify just boolean variable as the condition, it is not required to compare it with true or false:
palletInUse
The condition is not evaluated if nothing is happening, for that reason you have to make something happen constantly to have your condition evaluated. A typical way of doing is as you see in the following pictures:

SQL Code Execution

in the code below it seems that SQL is performing a calculation with a variable that is still not defined in the current context:
Abs([MVE_UP_100]/([MARKET_VALUE]*0.01)) AS MODIFIED_DURATION,
Sum(cst_sum_crosstab_intereses2.MVE_UP_100) AS MVE_UP_100,
As you see MVE_UP_100 is defined after the first line is executed, so I don't know why the code still does the calculation.
Any help?
Because MVE_UP_100 is a field name in cst_sum_crosstab_intereses2, so it is defined already but its content would be different that the contents of your aliased field

Adobe Livecycle: how to get the value of process data

I have a process data defined in Adobe livecycle, addField as a string. I am passing the value of this variable as an input when i invoke a process. Further i want to compare the value of this process data if it is true or false. I am trying to use the following expression:
string(/process_data/#addField)=string("true")
but i am not getting the value out of the expression. Is the above expression true? If not what is used to get the value of the process data?
I believe your XPath expression is wrong. I just did a quick mock-up in workbench and I got the correct response. Here are the details of what I did:
Created an input string variable i workbench called addField.
Created a two step process. The first step has two routes going out to two different set values.
On one of the routes, I added the following condition:
/process_data/#addField = "true"
Turned on recording, and invoked the process.
In the input parameters screen in workbench, I added the following text: true
In the recording, I can see the expression evaluating correctly and going to the correct set value.
Do let me know if you have any other questions.
Thanks,
Armaghan.

Syntax error in expression of SSRS

I have two datasets in my report and data is being displayed through a table. When I give expression like below:
=Format(Fields!InvDt.Value, "dsRepSalesReport_tblPrintSalesReport","dd/MMMyyyy")
It says there is Syntax error. If I remove dsRepSalesReport_tblPrintSalesReport part, there is no error.
1) Please advise how to wite the expression in format with aggregate expression.
2) If I write expression without dsRepSalesReport_tblPrintSalesReport part, my table repeats data and shows for all invoice. But when I add aggregate part, dsRepSalesReport_tblPrintSalesReport
Table just shows one value several times.
Please advise how to handel with these two issues.
Thanks
The method signature for Format is:
Public Shared Function Format(
ByVal Expression As Object,
Optional ByVal Style As String = ""
) As String
So that means you can't just specify the field and the Scope as in your first example; the first of the two arguments must return one value only.
In your example, you could use something like:
=Format(First(Fields!InvDt.Value, "dsRepSalesReport_tblPrintSalesReport"), "dd/MMMyyyy")
Which will format the first value in the specified Scope.
Another option would be to just set the value as required in the report then use the Format property:
It's difficult to answer your second question without knowing what your data/required results are... If you update the question with some simplified sample data to illustrate the actual issue you're facing that would be helpful.

Passing multivalue parameter to a subreport

I'm having a problem when working with multivalue parameters between reports.
I have a main report in which I have defined a multivalue paramer, which I use to run a SQL query to populate its dataset. The parameter is used in the WHERE clause in the following way:
WHERE values IN (#parameter)
It's working fine and it retreives the expected data.
Then this main report passes this parameter to a subreport. The parameter is also defined as multivalue in the subreport and, as far as I can see in the parameter's dropdownlist it receives the values in the right way. Something like this: A, B, C
The thing is that the query that populates the subreport's dataset returns nothing.
It also has a WHERE clause defined as in the main report (which is already working)
WHERE values IN (#parameter)
If I run the query manually, hardcoding the values to something like this:
WHERE values IN ('A', 'B', 'C')
it works, but when I try to use the parameter it doesn't. So, somehow it's losing the format or the values in the way.
I tried this solution in the subreport's dataset definition, which was proposed in another thread:
=join(Parameters!<your param name>.Value,",")
But it doesn't work for me, the dataset is still empty.
Any ideas about what I'm missing?
Thanks! :)
This should "just work." Make sure that the Parameter in the subreport is set up as multivalue, and I usually use the exact same query as in the parent report to provide "Available Values."
Check that you are passing the entire parameter to the subreport: In subreport properties on the parent report, the parameter's value should read [#MyParamName] not <<Expr>>. If it reads as the latter, edit the expression and make sure it doesn't have a (0) at the end. but =Parameters!MyParamName.Value is correct, not =Parameters!MyParamName.Value(0)
Just created the report from scratch again and it worked. I must have forgotten something in the middle.
Anyway, just in case somebody needs it, the two parameters, the one in the main report and the one in the subreport , must be defined as multivalue.
Then in your query you should use IN in your WHERE clase, something like this:
WHERE field IN (#parameter)
And nothing else is needed. I didn't need to do the following:
=join(Parameters!<your param name>.Value,",")
It just worked for me
I think I know what you did, as I was drawn here by having the same problem.
The subreports were setup fine, but when entering the parameter binding in the parent report, the Value drop down did not offer my parameter, so I used expression builder to select it. This left the grey << Expr >> marker in the value and would only work when I had only one value selected from the list. When I replaced this with [#MyParam] it worked fine regardless of the number of values selected. When I had a look at the value expression builder had created a bit closer it had =Parameters!MyParam.Value(0). Removing the (0) also fixes it.