unable to concatenate the first 3 characters of one list field with another list field in shareoint infopath form - function

I am trying to concatenate a designator field that combines my autonumbered index field with the first 3 characters of my group field
Index field automatically incremented current Highest index +1
I have another field that needs to Join the first 3 characters of my group field with the index field
example
Index: 1008
Group: ABM Support
Designator: (Desired result) 1008ABM
I get an error in the InfoPath form when I try to use:
concat((LEFT(Group,3), Index)
Expected value type: )
Actual value: ,
concat((LEFT(../my:Group,3)-->,<-- ../my:Index)
I have two Items I need to combine as a Designator for a SharePoint list. I have been able to auto increment the Index number, and I need to combine the index and first 3 characters of the group field to create the designator. I realize now I cannot use a concatenate string i.e. concatenate(LEFT(Group,3), Index). The problem lies that there are no common consistent characters to set a substring statement up. I was thinking to Add a default space at the beginning of the input and use that but not really sure how to go about that. Please advise if that would work and how to go about it.

Solution:
Concat(Substring(1,3),Index)

Related

How do I use function field's 'glidefunction:concat' correctly in servicenow?

I have created a new field in servicenow called QI (u_qi). I want to populate this field with three other fields in other words concatenate them.
My problem is, that the field is not showing up correctly. Instead of getting names, I get random chains of numbers and letters.
Here is the configuration:
And here is what I mean by random numbers and letter:
The only field showing up correctly is the number field.
Those aren't random numbers. The number field returns the CHGxxxxxx number and the other long strings are sys_id values that reference users. You need to call getDisplayValue to get a meaningful value:
glidefunction:concat(number,',',requested_by.getDisplayValue(),',',assigned_to.getDisplayValue())

Access Make table with memo field as column output instead of Text

The Access make table below does the following:
Final app number 10 has three sub apps 6, 7 ,8 in AppCombinedAreasandRegions. Their FirstOfRegion (Memo Field) respectively are "a","b","c". Based on the make table, the ConcatRelated function will create a row in the output table as follows.
Project Application: 10
Region_list: "a,b,c"
Currently I have this part working.
The issue is the output table stores Region_List ("a,b,c") as a TEXT field, meaning there is a limit and the value from the ConcatRelated function gets truncated. Since the source is a memo field, there will be cases where it exceeds the 255 character limit.
Is there a way for Region_List to be a memo field instead of a text field when using the ConcatRelated function to get the concatenated output?
The answer was to append to the existing table (clearing it first), and setting the concatRelated column from Group By to Expression.

lookup in ssrs and return a value

I have a table with three columns, in column 1 I have a name and column 2 I have a quantity.
I want to look up column 1 and return the value in column 2.
I used to the expression below and it wouldn't return what I wanted.
=Lookup(fields!NAME.Value, "Paul" ,1 , 0)
Could anybody tell me what expression I need to use?
You are close, sort of. To use the Lookup function properly, you need to change some things. Here is an example using the Lookup function.
=Lookup(Fields!Field1.Value, Fields!Field1.Value, Fields!Field2.Value, "DatasetB")
It takes 4 parameters. The first is the field/value from the current (in scope) data set that you want to be the value to match in the lookup data set. The second is the field in the lookup data set to match on. The third in the field to return when a match is found, and the last parameter is the name of the lookup data set.
Based on the expression in your question, it may actually work like this:
=Lookup("Paul" , Fields!NAME.Value, Fields!QUANTITY.Value , "DataSet2")
Of course, hard coding the name in the first parameter is probably not what you want to do.

SSRS Report Builder IIF error with aggregate

I've been struggling with an IIF error when trying to create a variable aggregate.
I'm using Report Builder 3.0
I have a report where users determine what fields are in a report. These fields are passed as a multivalue parameter. I use a lookup from a different dataset to determine its placement in the report, and using the same order dataset to determine if the field is numeric or not (meaning I want to sum the value based on row-level grouping). The headers pull in using the same field lookup, which works fine. At the row level I'm trying to return either the sum of the field value based on row grouping, or if non-numeric, return the value. Based on similar posts I understand that both the true and false parts are processed. I attempted to offset this error by nesting another IIF. If I remove the sum function the data returns non-numeric data fine. However if I include the sum function numeric data is processed fine however non-numeric data returns #error.
What am I missing?
Here is a definition of the data I'm referencing below:
lookupvalue: returns the fields selected by the user based on predefined order in a stored procedure.
Fieldisnumeric: indicates if the field selected is numeric or not, 0 is false, 1 is true
Fielditem: the field item in the tablix being referenced
dtsselectedfields: the dataset I'm looking up the column order and numeric properties of a field.
The number 1 indicates the first position in the variable count of fields selected by the user. Additional fields are hidden based on the count of fields passed in the parameter and are incremental (e.g 1-n).
=iif(Lookup(1, Fields!LookupValue.Value,
Fields!FieldIsNumeric.Value,"dtsSelectedFields")=0,
Fields(Lookup(1, Fields!LookupValue.Value, Fields!FieldItem.Value,
"dtsSelectedFields")).Value,iif(Lookup(1, Fields!LookupValue.Value,
Fields!FieldIsNumeric.Value, "dtsSelectedFields")=0,
Fields!MV.Value,sum(Fields(Lookup(1, Fields!LookupValue.Value,
Fields!FieldItem.Value, "dtsSelectedFields")).Value)))
****edit 12/1/2015****
For additional clarity, I'm providing additional details. Below is 'dtsSelectedFields' dataset.
FieldItem_____LookupValue_____FieldIsNumeric
Item1Desc__________1__________________0
Item1Total__________2__________________1
Item2Desc__________3__________________0
Item2Total__________4__________________1
Let's say I have one column of data, and this column would first look for a LookupValue of 1. This would return the FieldItem, 'Item1Desc'. Because this field is not numeric, I would want to return the value of Item1Desc. However let's assume my first selection was actually 'Item1Total' and I don't want to return the non-numeric Item1Desc field. In this case, because 'FieldIsNumeric'=1 indicating a numeric field, I want to take the sum of this field.
Is it possible to nest an aggregating function in an IIF statement on only one part of an IIF statement? I.e. the true part or false part?
And if so, what am I doing wrong?
An example of the tablix:
sample layout
Column 1 Header____________Column 2 Header___________Column 3 Header
Column 1 Data______________Column 2 Data_____________Column 3 Data
Sample data
Product___________________Country of Origin_________________Units
ABC Envelopes___________________China______________________15
LMN Packets_____________________India_______________________30
In the example above, user selects 3 columns, 'Product', 'Country of Origin', and 'Units'. There are other fields available that would cause multiple rows if I grouped by them in the stored procedure (for example acquisition price). Based on the lookup I return the column description as a header. The row-level detail is described as above (e.g. Return the product name and country of origin, but sum up the units).
As a workaround for my issue above, I found an (ugly?) solution.
As mentioned above, a user can select any number of columns and the report organizes them in columns based on a predefined order according to a stored procedure. (E.g. a product description would come before the sum of the units if those two columns were chosen, but a product ID may come before the product description, but only if the ID was chosen.)
For every possible number of columns a user can select, I added two columns in the report (i.e. two for each field).
The first two columns will reference the lookupvalue=1. I then set the expression of each field in the detail to 1) a sum of the value, or 2) the value itself. I then set the column visibility to the results of the 'FieldIsNumeric' column. So the summed numeric column which would return an error for non-numeric data would be hidden when FieldIsNumeric=0, and the non-numeric column referencing the lookup value =1 would be shown, and vice versa.
Needless to say additional columns would follow the same logic in sets of two, each referencing the sequential lookup value (e.g. columns 3 and 4 would reference lookupvalue=2, columns 5 and 6 would reference lookupvalue=3, and so forth. Each column within the matching pair would be displayed or hidden based on the returned value of FieldIsNumeric in the same lookup dataset.
I'm definitely open to suggestions, but thought I'd post this as a workaround solution.

FIND_IN_SET() not working for single value

I have table named post in which there is a column called visible_user_ids in which comma separated values are there. When I display the post by respective user then I used the FIND_IN_SET().
e.g. FIND_IN_SET('8','visible_user_ids') it shows the all the records from post table for user id 8 when visible_user_ids column contains comma separated user ids such as
3,5,8
8,5
8,1,12
etc.
but when visible_user_ids column contain only one value i.e. 8 then it does not display the post table record.
Please suggest a solution. Whether FIND_IN_SET() works for single value?
Instead of
FIND_IN_SET('8','visible_user_ids')
Try this
FIND_IN_SET('8',visible_user_ids)