TeamCity Single parameter in multiple configurations - teamcity-8.0

I'm trying to increment a parameter and use it in another build configuration.
My current setup is:
Template with several parameters, 4 of which are numbers, e.g. a, b, c, d.
I have 3 build configurations based on the template.
In configuration 1 I want to increment parameter a, or use the build counter.
In configuration 2 I want parameter a to be equal to configuration 1 parameter a and increment parameter b.
In configuration 3 I want a and b to be equal to configuration 2 parameter a and b.
Can anyone tell me how I can do this?
I was looking at autoincremental but that seems to just increment the same parameter across multiple builds which is not what I'm after as I don't want to increment the inherited parameters.
Thanks.

So in the end I used an artifact dependency to accomplish this.
Didn't originally want to use this in fear of builds to branch would cause artifact dependency to build as well, but found that would not necessary be true.

Related

Foundry Scenarios edited data materialized as dataset

Is it possible to materialize the edits made as part of a scenario into a dataset in foundry?
I want for each scenario to write out the primary keys of the objects edited as part of the scenario.
The motivation is that I need to run multiple processes to compute metrics as part of the changed values for each scenario, at a scale and runtime that is not possible to do with Functions.
Edit with details:
The thing is that I am not doing actual edits to the objects for the object type, I don't want to apply it.
I tested out the "Action Log" and it does not seem like this picks up "uncommitted" actions, meaning actions that is just run as part of a scenario. Also, it does not seem to be a link to the scenario it was a part of, even if the changes were committed.
The workflow is that I have Object Type A, and I define multiple scenarios S on a subset of the objects in A.
Each scenario might make something like 50k edits to a subset of A, through multiple Actions backed by a Function.
I save some of the scenarios. Now I am able to load these scenarios and "apply" them on A again in Workshop.
However I need to be able to get all the primary keys, and the edited values of A materialized into a dataset (for each scenario), as I need to run some transformation logic to compute a metric for the change as part of each scenario (at a scale and execution time not possible in Functions).
The Action Log did not seem to help a lot for this. How do I get the "edits" as part of a saved scenario into a dataset?
The only logic you can run BEFORE applying will be functions.
Not sure about your exact logic but Function's Custom Aggregations can be very powerful: Docs here
this might not directly let you calculate the Diff but you could use the scenario compare widgets in workshop to compare your aggregation between multiple Scenarios
e.g. you have a function that sums(total profit)
Your Workshop could show:
Current Data:
$10k
Scenario A:
$5k
Scneario B:
$13k
instead of like:
Scenario A:
-$5k
Scenario B:
+$3k
Afaik there's no first class way of doing this (yet).
"Applying" a scenario basically means you're submitting the actions queued on the scenario to the ontology. So neither the actions nor the ontology are aware that they came from a scenario.
What I've been doing to achieve what you're working on is using the "Action Log". It's still in Beta so you might need to ask for it to be enabled. It will allow you on each action to define a "log" object to be created that can track the pks of your edited objects per Action.
How I do the action log is:
My Action log has the "timestamp" of the action when they were run.
My Scenarios have the "timestamp" of when it was applied.
Since "Applying a Scenario" means -> actually running all actions on Ontology (underlying data) this gets me this structure if I sort everything by timestamp:
Action 1
Action 2
Scenario A applied
Action 3
Action 4
Scenario B applied
this allows you to do a mapping later on of Action 1/2 must come from Scenario A and Action 3+4 come from Scenario B.
EDIT: Apparently you might be able to use the Scenario RID directly in the Action Logs too (which is a recent addition I haven't adopted yet)
This won't allow you tho to compute (in transforms...) anything BEFORE applying a scenario tho

Cognos Report Studio 10.2 multiple reports from one master

We are needing to build a huge amount of reports, but alot of the metrics and fields are duplicated. Is it possible to build 1 (or a few) report to incorporate everything, and then based on what 'report' is requested to be run by the user, it hides/shows certain fields?
e.g. master report contains columns 1-100
user 1 needs to run report A, which uses columns 1-20, so hides columns 21-100
user 2 needs to run report B, which uses columns 21-40, so hides columns 1-20 and columns 41-100
Any help would be appreciated!!
Yes it's possible.
Go to condition explorer and create a string variable based on
#sq($account.defaultName)#
Create values for all possible usernames.
Use this variable as a Style variable and set up report presentation (show/hide columns) for all values.
And think about using groups not named users with
#CSVIdentityNameList()#
It will be more complicated but you won't stick to chosen usernames.
I would create report views pointing to the single report, one for each version of the report you want to run. Each view would pass in a different static value for a common parameter, say 'reportType'. The report would then use this static value to change the output returned to the user. This can be accomplished with hiding columns as Alexey suggested or you can create multiple pages and use a render variable that tests the value of the 'reportType' parameter and renders the appropriate page. The benefits of this approach as opposed to hiding is easier maintenance and a potential performance improvement as non-displayed columns are not retrieved from the data source, especially if the non-displayed columns force expensive unnecessary joins.

SSRS Pass parameter / Field value from 1 table to another

I am using SSRS 2012.
I have two datasets. I have two tables.
The first table contains a contract Id which is used as parameter in the second dataset.
I want to set the parameter as the contractId (ie Fields!ContractId.Value, or ReportItems!Contract1.Value) or something like that but nothing works because of different limitations.
If I would be using a subreport that would have been easy just pass the Field!Contract.Value from the 1st dataset as the parameter for the second and there you go. But since we want to call the report using SQL server agent, I cannot use subreport since the agent is limited and does not accept subreport.
So I believe my only option is to use two different tables, but I still need the value from the first dataset. Also, I don't think LookUp() would work for me as I do not have Ids.
Does anyone already did something like that?
Thanks for any help.
You can create report parameters in which the available values are pulled from a query.
Then just use the parameter in your second data set.

Get current entity id and use in SSRS report

I'm creating a report which is scoped to individual record level for Service Cases in Dynamics CRM 2011.
This report has 4 datasets; 1. Filter, 2. TicketDetails, 3. Materials and, 4. Labour.
The Filter dataset is there to grab the IncidentId of the current service case being viewed in CRM.
SELECT IncidentId FROM FilteredIncident AS CRMAF_FilteredIncident
I have a parameter called incidentfilter, it's source is the Filter dataset. CRM seems to be ignoring the CRMAF_ prefix and just returning all service cases.
Datasets 2 and 4 are both have a where clause to filter on the incidentfilter parameter value. Dataset 3, queries GP, for that I pass in the TicketNumber field from the service case.
My report seems to be running, it's just that it retrieves every service case from CRM.
I've had similar problem with CRM ignoring the CRMAF_Prefix. You can try this:
Just to make sure, do you have more than one table you are trying to apply the CRMAF_prefix on? If you have, make sure you limit the number of tables to just one.
You could try to add the CRMAF_prefix to the fields as well:
SELECT CRMAF_FilteredIncident.IncidentId FROM FilteredIncident AS CRMAF_FilteredIncident

Totaling Expression from group header in SSRS

I'm trying to check our compliance with standards for documenting patient information, using SSRS 2008 R2. For example, in the group header for PatientID, I have =Not IsNothing(Fields!DATEOFBIRTH.Value). Now, I'd like to count the number of patients for which that returns True. The obvious way is
=Sum(Iif(Not IsNothing(Fields!DATEOFBIRTH.Value)
, 1
, 0
)
)
(which actually doesn't work, because I have multiple lines per patient, but never mind that for the moment.) The problem is that if I find my logic was wrong, I have to make the correction in two places, and it won't be obvious if I forget. In Crystal, I'd either use a running tally, evaluating on the change of group, or a manual tally with WhilePrintingRecords;, having a formula returning the T/F result in both locations. What's the generally-accepted SSRS way to do this? Thanks.
If you want to centralize logic, you can either use custom code in a report or create a custom assembly. With custom code, you'd have to update every report that uses that same logic if you find you need to make change, but it's simple to add to a report. With a custom assembly, you have to create a class library, compile it and add the code to your machine so BIDS can use it (and to every developer's machine if applicable) and to the report server. The advantage with the custom assembly is that there is one place to store the logic (not counting the distribution of the DLL) so every report gets updated automatically when you update the logic. This link is a starting point for you and provides links to more details on both of these options: http://msdn.microsoft.com/en-us/library/ms155798(v=sql.100).aspx.