I have job on jenkins, to which I pass config as a variable on the axis.
I'd like to add a second variable to the same job.
So now I have:
Campaign1: A
Campaign2: B
etc.
I'd like to introduce a second variable so I'll have
Campaign1: A Alpha
Campaign2: B Beta
If I introduce a second axis - I'll get a matrix build, and I don't want that.
Do you have any ideas?
Well as it turned out the easiest way to do it is to make the job parametrized. Or write a bunch of exceptions if that's your cup of tea and you have time for that.
Update: In the end I just put a delimiter between 2 variables and passed them as one and then I cutted them in a script.
Related
I'm using SPSS and hoping to create a new variable that houses the sum of a group of previous variables. The catch is: if any of the variables are recorded as "9" then I need to leave them out.
Is there a command that makes this relatively easy? I had thought of doing DO IF, but it seems like that would get extremely tedious with 6 variables as I'd have to code each possible instance unless I'm mistaken. If there is an easier way that I just haven't been able to find, I would be forever grateful!
This is what I'm thinking would need to be done, but could absolutely be wrong:
DO IF (var1<=4 AND var2<=4 AND var3<=4 AND var4<=4 AND var5<=4 AND var6<=4).
COMPUTE newvar=SUM(var1,var2,var3,var4,var5,var6).
ELSE IF (var1<=4 AND var2<=4 AND var3<=4 AND var4<=4 AND var5<=4 AND var6=9).
COMPUTE newvar=SUM(var1,var2,var3,var4,var5).
/* And so on and so forth for each possible variation of the sum.
It's not that this didn't work, I'm just checking to see if there's an easier way before committing the time to it.
Here are some ways to make it shorter:
missing values var1 to var6(9).
compute newvar=sum(var1 to var6).
Now if you don't want to just mark value 9 as missing, but to get rid of it all together:
recode var1 to var6(9=sysmis).
compute newvar=sum(var1 to var6).
If you don't want to change anything in the data, you can go:
missing values var1 to var6(9).
compute newvar=sum(var1 to var6).
missing values var1 to var6().
If all those sulutions are problematic for you, here's the classicle loop solution:
compute newvar=0.
do repeat vr=var1 to var6.
if vr<>9 newvar=newvar+vr.
end repeat.
exe.
Here's another solution just for fun:
count nines=var1 to var6(9).
compute newvar=sum(var1 to var6) - nines*9.
I'm looking for plugin where I could have aggregation of settings and view for many cases, the same way it is in multi-branch pipeline. But instead of basing on various branches I want to base on one branch but varying on parameters. Below picture is from mentioned multi-branch pipeline, instead of "Branches" I'm looking for "Cases" and instead of "Name" column I need to have configurable Parameter.
Additionally to it, I need to have various Periodic build triggers in way
H 22 * * 5 %param1=value1 %param2=value3
H 22 * * 5 %param1=value2 %param2=value3
The second case could be done in standard job, but since there will be many such cases launched periodically every week or two weeks or every month, and difference in param1 is crucial and is important to have it readable and easily visible to quickly distinguish which case have failed.
I was looking for such plugin but couldn't find something like this. Maybe someone knows such plugin or way to solve it.
I have alternative of creating "super"job which in build steps would launch my current job with specific parameters. Then my readability would change from many rows to many columns since the number is over 20 it will IMHO significantly decrease readability(in column solution) and additionally not all cases would be launched with same periodicity. So there would be necessity to have some ready sets assigned by parameter, and most often the super build cases would have mostly skips in it. What would result that one might not see last result for one of the cases.
Note, that param2, has always same value for periodic launches. Other values are used only with manual trigger. Param2 can but doesn't have to be visible on "multi-branch pipeline" like solution.
I hope my explanation of issue is clear. Looking forward for answers\suggestions etc. :)
So at work I have been tasked with the painful job of having to build an HTML email template for Jenkins using the Jenkins Email Extension plugin. I've managed to get everything I needed for the template except for one piece. I need to calculate the passed percentage of the test run, but I can't find any way to run basic math operations in Jelly.
I've got the string values for 2 numbers (passed tests and total tests) and all I need to do is run (passed / total * 100) so I can get my percentage value. Is there any way to do this in Jelly?
You should be able to do something like this:
${it.yourPassedVariable / it.yourTotalVariable}
As long as you reference your variables and do the calculation within the ${}, you should be good.
I have a likert scale, (1-7), I want to group responses 2 to 7 together and leave out response 1. I'm using SPSS and getting a little confused.
I'll assume you wanted to convert a variable. Lets call a variable "var1", and it needs to be converted to a dummy variable (0 and 1). In this case, your original variable can be transformed to "var1r" by using the following code.
RECODE var1 (1=0) (2=1) (3=1) (4=1) (5=1) (6=1) (7=1) into var1r .
The previous codes, creates a new variable, in which higher responses (2-7) are denoted by 1, and lower numbers (1) are denoted by 0. If you cross this variables in a cross tab, by using the next syntax:
cross var1 by var1r .
It would show your different values correspondingly. The latter is a way to verify you have recode your variables correctly. You can use the similar syntax and change variables at will.
Good luck!
I think the best way is to clone the original variable and then RECODE it into the same variable. The advantages are that you'll keep your variables in the same order and you already have the variable label and value labels. So if the variable name is v1, clone it and run
RECODE v1 (7=2).
Now adjust the value labels with
ADD VALUE LABELS v1 2 "this value means ... or ...".
Here you give the meaning of values 2 and 7. For "leaving out" value 1, specify it as a missing value like so
MISSING VALUES v1 (1).
This presumes 1 is the only missing value. Now check all this by running
CROSSTABS v1 by copy_v1.
presuming your clone is called copy_v1. Following these steps is a short and safe road to a perfect result.
UPDATE
I think this syntax -although valid- may not be what the OP meant. Also, see comments below.
For recoding 1 into 0 and all other values into 1, an alternative is
compute v1 = v1 gt 1.
This looks like invalid syntax but it's explained in this tutorial. You can use this trick for a lot of other stuff too.
For staying on the safe side, first clone the original variable so you can cross it with the recoded version to ensure that the result is correct.
Since the last post is closed due to unclear expression, here is a edited one.
There are in total 20 items from 5 Likert-type scale questions from a questionnaire. I need to add the 20 items from 5 separate questions to create a total scale. I already got the data.
The question is just like the picture above. How can I run the command to add the 20 items from 5 separate questions? What is the command?
Is it something like Transform > Compute variable. Enter a variable name, specify which items to add up, and hey presto (e.g. "V1+V2+V3" etc)?
You can do exactly as you suggested, using the Transform -> Compute variable... function. Simply type in the name of your new scale in the Target variable box and the addition you want in the Numeric variable box.
You will see that the following SPSS syntax command is run:
COMPUTE total=v1 + v2 + v3 + v4.
EXECUTE.
If any of the variables has a missing value, the simply adding them will result in a missing value as well. If you don't want to impute for missing values, using the MEAN command in syntax works well. Also, if the variables are contiguous in the data file, you can make the syntax much more readable by using the TO modifier.
COMPUTE myscore=MEAN(variable1 TO variable5)*5.
The resulting value provides an efficient expected value.
However, it seems like the problem in this case is that the data entry process has dummy coded all of the items, producing 20 separate variables instead of 5, where each block of 4 variables has a value of 0 or 1 but represents the values 1 to 4. In this case, you can use the following syntax:
COMPUTE mycounter=1.
COMPUTE myscore=0.
EXECUTE.
DO REPEAT a=variable1 TO variable20.
COMPUTE myscore=myscore+mycounter*a.
COMPUTE mycounter=mycounter+1.
IF (mycounter=5) mycounter=1.
END REPEAT.
EXECUTE.
Note that the variables from variable1 to variable20 must have each set of dummy codes from the original items clustered together in ascending order.