Watson Assistant - Condition with variable - watson-assistant

Can I use a condition with a variable that I created? Specifically, how can I indicate that the variable value [text and/or numbers ] with max of 15 characters for the user input? I've been trying to set the condition in order to verify the user input of characters, with max of 15 characters between text and/or numbers, but it dosen't work. I've made a variable [ $codice_fiscale ] but I can't aplly the condition. Can you please help me in order to make it work?

Related

Add Percentage symbol in SSRS column's expression

I have a column in which for all the values of column I need the percentage symbol in the end. So what should I put in the expression for this.
Like currently I have in the expression ->
=Fields!Contribution_Margin_.Value
To get this '%' symbol in the end what should I do? All the calculations I have done at the backend so only the symbol is required.
If your column is a decimal number that represents the percentage you can just use the format function to format the number:
=format(Fields!Contribution_Margin_.Value,"0%")
Or if you want to keep the value as a number within the report, you can set the Format number property of wherever it is displayed:
It depends on how the number is stored.
Let's say you have a value that needs to be shown as 12.5%
If the value stored in your dataset is actually 0.125 (this is the correct way) then all you need to do is set the format property of the textbox to p1. The means "format as percentage to 1 decimal place"
If your dataset value is actually 12.5 then you can set the format property to something like
0.0 "%" to show to 1 decimal place or
0.00 "%" to show to two decimal places etc.
Alternatively you could just divide the value by 100 to get back to a "proper" percentage value and use the standard formatting codes as shown in the first example.
If all you need is to add % symbol; just add the % symbol in the same textbox as your placeholder, not in your expression.

Can I use a field name which contains a period (".") in my data source for ag-grid?

I have a data source which contains fields with periods in their name. e.g.
[{
"id": 1234,
"OD.name": "Andrew",
"OD.age": 21
},{
"id": 1235,
"OD.name": "Roofus",
"OD.age": 22
}]
However, when I bind this to the grid the values for columns which contain periods in their field names are not rendered. Is this a known bug/not-supported in ag-grid?
Just make sure that suppressFieldDotNotation is set to true.
From the ag-grid reference
https://www.ag-grid.com/javascript-grid-properties/
If true, then dots (eg address.firstline) in field names are not
treated as deep references. Allows you to use dots in your field name
if you prefer.
The field name is going to be interpreted by the grid as an expression, so if you provide a field name.of "OD.name", it will try to find the "OD" property of your data row, and then try to find the "name" property of that. Of course, that's not going to work.
However, you can supply a "valueGetter" function in your column definition, which will be responsible for supplying the value to the grid. In that function, you can do whatever you need to do to get the value from the row and return it.

In SSRS, how to include first row from different dataset in tablix?

I am creating a report, the purpose of which is to print a letter to many different people. Obviously each person's name, email, etc. will be different. For this I am using a list, which I understand uses a tablix.
Now inside each letter I also need some global data that comes from a dataset. For example, the company email, telephone number, etc. This data will be the same for every letter. However, every time I try to use some expression to get this, I get an error such as:
The Value expression for the text box ‘Textbox11’ refers to the
field ‘URL’. Report item expressions can only refer to fields within
the current dataset scope or, if inside an aggregate, the specified
dataset scope. Letters in the names of fields must use the correct
case.
The expression I'm using to get the above error is
=LookupSet(true, true, Fields!URL, "SystemVars")
I've tried other things but I can't figure out what I need to make it word.
Is there an expression I can use to solve this problem? If not, what steps should I take to get my letters working?
You are missing the ".Value" portion in the expression. Try this:
=First(Fields!URL.Value, "SystemVars")

Add validation to numbers stored as text in Access

Field name in MS Access table - s1
data type - text
I use this field to store student marks.
'AA' will be entered if the student is absent and therefore I have selected text data type for this field
I want to restrict data entry to minimum marks = 0 and maximum = 75
How do I enter validation rule in this text field?
You may want to reconsider your decision to store the values as Text. You could store them as Numeric and just use a custom Format property to display AA when the value is Null (which is allowed when "Required=No"):
Set maximum length of the text of the field to: 2
Set validation rule to: "AA" Or Between "00" And "75"
Also, apply an inputmask to force two characters, or make sure that values between 0 and 9 are entered as 00 and 09.
In design view for your table that will store the student mark, select the student mark field.
In the field properties in the lower part of the screen set the Field Size to 2, the Validation Rule to "AA" Or Between "0" And "75" and then in the Validation Text field, write a helpful message to the user describing the valid data they can enter in to this field:
If the user tries to put in data outside the restrictions of your validation rule, they'll see your validation text message and won't be able to save their invalid data:

SSRS limiting number of characters for a parameter

How can I limit the number of characters a user can type for a parameter in SSRS?
For example, if the Data Type is set to TEXT, how to limit the user to type only 6 characters after Default value of "CL/" OR limit to total of 9 characters.
Unfortunately you can't perform validation as people write values, you can only handle them when the report is run. You can however use Code behind the report to perform some validation on your Parameters at run-time. Based on the result of this you can then either display the required data to instead return an error message.
To insert some code behind you right click the area around the report, Choose Report Properties, then Code.
Enter something like this into the code panel
Function Validate(param) as Boolean
If len(cstr(param)) <= 9 Then
Return"True"
Else
Return "False"
End if
End Function
You can then refer to the result of this from a text box that displays an error as follows
Right click the text box and set the visibility to be
=iif(Code.Validate(Parameters!myInput.Value) = True, True, False)
Then if you enter a string of 9 or fewer characters you will get an error that you can use to inform the user of the proper format of your desired input string.
Instead of just making text boxes visible/invisible, you could also apply this to rectangles that store your report information. Also, you can use visual basic coding to alter the Code behind to perform more complicated parameter validation to check for you "CLI" string for example.
I hope this helps, let me know if you require further help.