Added Variables Not Filling Out When Merging Files - spss

I have two data sets that I want to Merge on the variable Survey ID.
The first data set can have one survey ID listed more than once.
The second data set will only have unique IDs.
I chose Data-->Merge Files-->Add Variables-->Join on Survey ID.
But, I can see in my exported data that whenever a survey ID repeated in the first data set, it didnt merge properly with the second data set.
See below for what happened:
So Country and Segment came from the second data set. But you can see that on the second instance of ID 1013304, it's not filling in. I want that blank row to also say Country: Japan, Segment: C.
How can I achieve this?
Thanks! (:

It may be your problem is not sorting both files in advance. In any case this should work for you:
*open the file with unique data.
sort cases by Survey_ID.
dataset name unique_data.
*open second file.
sort cases by Survey_ID.
dataset name full_data.
match file /file=* /table=unique_data/by Survey_ID.
exe.

Related

How to retrieve specific value from LIST using SELECT

I keep retrieving the entire LIST of Customer's Total Amount instead of the Specific Customer. I have tried using SELECT according to their Order ID to filter out other Customer. However, the result is still the whole list.
My code here
I have tried to FILTER using Customer Name and Order ID. However, the outcome is still the same, returning the entire LIST of Total Amount.
If you reference connect your line items to your order, app sheet will natively create a reverse reference on the order table that contains a list of all of the corresponding line items for that order.
The list that you're looking for lives in the data inside that column. To get the data out you need to do a list the reference, which will extract the value of whatever column you specify out of that reverse reference, creating a list of the values you want from those child records.
Then if you wanted to create a total for all of those line items, you could wrap that list dereference in sum().
References are the key to making just about everything advanced work inside app sheet, definitely worth wrapping your mind around.

IBM DOORS how to import rows from excel to specific place in DOORS

I have some rows in DOORS identified by a number. For example
Object Identifier
Description
1
description of object 1
2
description of object 2
3
description of object 3
4
description of object 4
I know if I want to modify an existing object, I just import an excel that has the columns Object Identifier and Description with the same number in the Object Identifier column, as the object I want to modify.
If I want to create new objects, I import rows with empty Object Identifier column. They get the identifier assigned automatically and will be inserted in the bottom of the table in DOORS.
But I want to modify some existing objects and create a new object specifically under the second object.
Object Identifier
Description
1
modified description of object 1
2
description of object 2
5
new object
3
modified description of object 3
4
description of object 4
How can I do this in one import?
I'm not aware of an official support for this. One method could be to have an additional column called e.g. "below". In this column, the excel editor might enter the object number of the parent object.
Then, after you imported your excel to DOORS, you would run a code like this, which moves every object where "below" is set, below the referenced parent object
Object o
Module m = edit … (or current or whatever)
Skip sk = create
for o in m do {
put sk, o, o
}
for o in sk do {
int iBelow = intOf realOf (o."below""")
if (iBelow) {
move o, below object iBelow
o."below" = ""
}
}
save m
As far as I remember while screwing up a whole DOORS module, when you select to import (the excel file in a csv format), you can choose to update or create.
If you pick update, it will ask for the column with unique identifiers (usually, the object IDs column) and for the objects that doesn't have a number, they will be created, updating the ones that do have an ID, but (as you state in the question) the new ones will be added at the bottom.
Now, we are only using the ID attribute of the objects, which makes them unique even if is moved, deleted or flushed, but for the meaning of sorting, that attribute is meaningless, because if you copy an object (from the same module or from another) the ID updates to the next available according to the ones in the module.
The attribute that tells DOORS how to structure and sort the objects, is actually the Object Number
"... hierarchical ..." is the keyword here. That attribute tells DOORS the order of the objects and which is parent/children of which.
Now, I don't really remember if that attribute can be modified in the csv, but there are two DXL scripts that combined, enable that while importing:
\IBM\Rational\DOORS\X.Y\lib\dxl\example\oslc\ hierarchy.dxl
\IBM\Rational\DOORS\X.Y\lib\dxl\standard\import\ commas.dxl
Unfortunatelly, I couldn't find the combined script, but I know it uses those 2 (some time ago I was making the DXL to do almost the same as you want, but someone else at my work managed to do it first and with time, it was no longer necessary)
Here is the reference manual (image is from page 402/1006)
And this page has some good scripts, too.
I hope my answer helps you to build that script (or find some coworkers that do it before you do, hehe)

InfluxDB - batch write multiple points with the same tag

When I write multiple points with the same tag value, it only writes the first point to the database.
Is this a bug or must be different tag values when writing multiple points?
Thank you!
It is a feature, not a bug. You need to create unique points, otherwise non unique points are "deduplicated". See doc https://docs.influxdata.com/influxdb/v1.7/troubleshooting/frequently-asked-questions/#how-does-influxdb-handle-duplicate-points
A point is uniquely identified by the measurement name, tag set, and timestamp. If you submit a new point with the same measurement, tag set, and timestamp as an existing point, the field set becomes the union of the old field set and the new field set, where any ties go to the new field set. This is the intended behavior.

How to build "if statement" in SPSS Modeler?

could you please advise how to build "if statement" in SPSS Modeler if we have two data sources?
One data source (1) is a table (an output node generated by SPSS Modeler) where all the IDs are listed with which we need to work further.
Another data source (2) is an Excel file where all the IDs are listed whereas this list includes some IDs from (1) but also some additional ones - to all these IDs are assigned values that are needed to be added to the data source (1) not necessarily to the table.
So if the ID from (1) is in (2) we would like to assign a value from (2) to the ID in (1) and have it stored in some table or even better in a file.
Thank you very much for your help / advice.
Patricia
Based on your problem it sounds like you want to merge these datasets. This can be easily done in Modeler via the Merge Node, just make sure the variables have the same name or Modeler won't recognize it as a key. You can see an example here
You can also create a flag variable using the Derive node, see example here
You will have to use the Merge Node to combine the 2 datasets but you don't have to give the same name for the keys IDs. You can use the option condition in the Merge Node without the necessity of having the same name and even the same type of variable.
Syntax example for the merge Node - option condition: 'ID' = 'id'

Visual Studio REST API Iteration and Area ID's

I am working with the VSO REST API and have a question on how Iteration and Area ID's are assigned. Specifically, why is it when I assign a work item to the root Iteration or Area the ID that is returned for the WIT is not returned when I query the classification nodes?
For example, imagine I have this hierarchy when I query /DefaultCollection/my project/_apis/wit/classificationnodes?$depth=2
My Project: id=1234
Area 1: id=5678
Area 2: id= 9012
And I then query for a work item using /DefaultCollection/_apis/wit/workItems/1?$expand=all
If the work item is in Area 1 or Area 2, the System.AreaId field is as expected (5678 and 9012, respectively). However, if I assign the work item to My Project, the System.AreaID is some value that is not included when I query for all classification nodes. There appears to be some kind of relationship between the ID's as they are serial (e.g. the ID returned by the classification node query is 1232 for the area and 1233 for the iteration), but I can't seem to find a way to query to get the actual ID returned by the work item query.
In fact, not only is the ID returned for a work item not present when I query for all classification nodes, if I assign the work item to both the root iteration and area, the ID returned for both fields is the same value that is not included in the classification node query.
What I need is a way to look at a work item and figure out the area and iteration it belongs to. I could probably do something with the path field strings that are returned, but that seems error prone since users can change them.
****Edit****
The above appears to be a bug in the REST API, but for anyone who comes across this post there is a way to get a usable iteration ID by the path string. Structure your REST call like so:
/DefaultCollection/[Project Name]/_apis/wit/classificationnodes/iterations/Release 1/Sprint 1 (etc.)
I have never done this with ID. I only use the path. In the classification service you can get the node by path easily enough.
For example, using the REST API - you can access this url to get the data about a specific iteration:
/DefaultCollection/[Project Name]/_apis/wit/classificationnodes/iterations/[Release X]/[Sprint Y]
Note that trying to access the default iteration path (the project name instead of a specific iteration) will return an error:
/DefaultCollection/[Project Name]/_apis/wit/classificationnodes/iterations/[Project Name]
will give :
{"$id":"1","innerException":null,"message":"VS402485: The node name is not recognized: [Project Name]","typeName":"Microsoft.TeamFoundation.WorkItemTracking.Server.Metadata.WorkItemTrackingTreeNodeNotFoundException, Microsoft.TeamFoundation.WorkItemTracking.Server","typeKey":"WorkItemTrackingTreeNodeNotFoundException","errorCode":0,"eventId":3200}
So if you do batch work, you have to filter those before querying the api.
There are three ways of identifying an Area (everything I post equally applies to Iterations also). The Path (string), the ID (int) and a Guid. each of them are used in different ways, and have different ramifications.
For example renaming an Area, does NOT change it's identity, therefore does not update a work item (the path returned for in a workitem is dynamic).
It is also possible to delete and recreate and identical path, but it will have a different ID.
The GUID is used primarily for the Excel Reports (such as are parent of the SharePoint portal)
Depending on how you want things to react determines the appropriate element to use.
I have not seen any issues with the ID that you mention, and if you could create a simple repro, I would be glad to look at it.
david(dot)corbin(at)dynconcepts(dot)com

Resources