Using datum w. numerical index instead of column name - vega-lite

Is there any way to access a column in datum using its positional index such as datum[1] (doesn't work) instead of datum.ColumnName or datum['ColumnName']?

Related

Filtering out results based on length of reference number

I have a report, in report builder, where I am getting duplicate rows based on the reference number.
In the below example, is there anyway that I can remove any reference number that is longer than 9 digits using an expression, I've looked into using LEN but cant seem to make it work for me! I am very new to SQL and report builder.
You can use a Filter on either the Dataset or the object (table, chart...).
The Filter Expression would be the LEN of you field - =LEN(Fields!HB-RENT-REF.Value)
The Type would be Integer.
The Operator would be <=.
And the Value would be 9.
This would only allow records with a HB-RENT-REF field length of 9 or less.
MS Docs: Dataset Filter
If you're using SQL scripts or procs to build your report, then you could simply include a WHERE clause that checks for if the length of your column, using the LEN() method, is less than or equal to your condition. So something along these lines:
SELECT *
FROM YourTable AS yt
WHERE LEN(yt.YourColumn) <= 9;
You will want to replace the * with the specific columns you want and use the appropriate tables too of course. But that's the general idea of checking for length in a WHERE.

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.

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

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)

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.

Create a numeric-type calculated field using concatenation, in MS-Access

I have a column ProjectYear and a column ProjectNumber; both are numbers. I created a calculated column ([ProjectYear] & "" & [ProjectNumber]) which concatenates the two. For instance, 2015 and 123 gives 2015123.
The issue is that the resulting type of that calculated columns is Short Text, and when I create a query to join to another table which has that column in, but as a numeric type, I get a type mismatch error.
How can I make the calculated column have a numeric type?
I tried CInt([ProjectYear] & "" & [ProjectNumber]), but that it is not allowed.
A calculated field expression can only use a limited set of functions. CInt() is not supported, but Int() is.
I tested this one in Access 2010, with Long Integer for the calculated field's Result Type property, and it does what I think you want ...
Int([ProjectYear] & [ProjectNumber])
Note I believe you are asking about a calculated field in table design, such as this ...
Also note that a calculated field can not be indexed. That has performance implications when you use that field in a join to another table --- although the datatypes can be compatible, it can't take advantage of indexed retrieval.