C# Script Task string variable replace wont replace
The code below ought to replace "A" with "B" but it doesnt.
Please tell me how to make this work. Thanks!
Doug,
it returns a new string (does not assign to the same)
So you need fn = fn.Replace("A", "B");
Arthur
MyBlog
Twitter
Similar Messages
-
C# Script Task - MessageBox Variables
I dont know C#, so I thought I would start simple and try to do message box a variable. I am struggling even with that.
In VB.net I would print a value of the variable in a message box using the following syntax.
Msgbox(dts.variables(“VariableName”).value.tostring)
In C#
MessageBox.Show(Dts.Variables
At the point of selecting variables it is giving me this message.
Error 1 Non-invocable member 'Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTAProxy.ScriptObjectModel.Variables' cannot be used like a method.
I have following using statements defined. Do I need more?
using System;
using System.Data;
using Microsoft.SqlServer.Dts.Runtime.VSTAProxy;
using System.Windows.Forms;
using Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTAProxy;
I might be missing something. Can anyone help?
Thanks
SuthaWhy do I get the following exception?:
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript() -
Replacement string variable in data form
Hi everybody,
in Planning 11.1.2, is it possible to set a replacement variable, with type String, and then use it in a data form to let the user inserting a string value (i.e "actual")?
I need to reuse the value inserted in a business rule. I think to use the @MEMBER to refrence it to the corresponding dimension member.
For example:
If I define a string variable named SCENARIO and the user insert in the data form "actual", can i reference it in a cross-dimension:
Account1->Peiod1->Fy12 -> @MEMBER(SCENARIO)
does this cross-dimension return the value corresponding to Account1->Period1->FY12->Actual?
Thank All
MaurizioWhy you just don't use RPT with type Member ?
Users chose member name from the LOV (no chance for mistake) and run your rule -
Script task within child package - breakpoint wont hit, trying to find missing variable
Im calling a child package and its failing on a script task with a message which indicates one of the variables cant be found
The script threw an exception: The element cannot be found in a collection.
So I remove the readonly/readwrite section, and place a breakpoint on the very first line of the script task. When I run the main package, by breakpoint on the child package script task isnt hit but I still get the error about the missing variable.
How can I find out which variable its complaining about?You can raise an event in the script using FireInformation and pass into it the variable content as string
examples:
http://technet.microsoft.com/en-us/library/ms136054.aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-1
The variable content will put into the Output window (go to View menu to enable it).
Arthur My Blog -
Hello All,
Here is what I am trying to do...
1. I am having two rows, one column in an Object Variable. (vLoopCountObj).
2. I am having 30 Rows, 2 Columns in my second Object Variable (vTableRowsObj)
3. I have a FOR EACH LOOP which will run for number of rows in vLoopCountObj i.e 2 times here.
4. I have a Script Task inside the FOR EACH LOOP to display all the rows of vTableRowsObj.
5. When I execute, 30 Rows gets displayed only once. It will not display when the loop goes for second iteration. Please help me to display for second time.
6. I have used below code to display the rows whithin the script task which is in SSIS dataflow task.
Imports System
Imports System.Data
Imports System.Math
Imports Microsoft.SqlServer.Dts.Runtime
Imports System.Xml
Imports System.Collections
Imports System.Data.OleDb
Public Class ScriptMain
Public Sub Main()
Dim oleDA As New OleDbDataAdapter
Dim dt As New DataTable
Dim col As DataColumn
Dim row As DataRow
Dim sMsg As String
oleDA.Fill(dt, Dts.Variables("vTableRowsObj").Value)
MsgBox("Number of Rows " + dt.Rows.Count.ToString())
For Each row In dt.Rows
For Each col In dt.Columns
sMsg = sMsg & col.ColumnName & ": " & row(col.Ordinal).ToString & vbCrLf
Next
MsgBox(sMsg)
sMsg = ""
Next
Dts.TaskResult = Dts.Results.Success
End Sub
End ClassHi Raj,
It is verrrry interesting issue. I can also confirm that it doesnt loop again. I've made a simple test and figured that in the second loop even you fill the Dataadapter, record count is zero. Which brings me up to the idea: Somehow, after you read the object
variable resultset, you can not read it again in the for each loop.
Strange, probably a bug or a technical issue that is beyond my existing knowledge.
I can provide a workaround. You can also loop in script task for first variable. (Nested loops)
Let other members to examine and comment on this.
Regards
Onur
(For others who also wants to test, here is my scenario
Execute SQL Task 1:
Query: SELECT 1 as Cnt UNION ALL SELECT 2 as Cnt
Resultset: Full Resultset
ResultSet Tab: Name: 0, Variable Name: User::vLoopCountObj;
Execute SQL Task 2:
Query: SELECT 1 as ColA, 2 as ColB UNION ALL SELECT 3 as ColA, 4 as ColB UNION ALL SELECT 5 as ColA, 6 as ColB
Resultset: Full Resultset
ResultSet Tab: Name: 0, Variable Name: User::vTableRowsObj;
For Each Loop Container:
Collection: Enum: ForEach ADO Enum
Source Object: User::vLoopCountObj
Enum Mode: Rows n the first Table
Script Task:
ReadOnlyVariables: User::vTableRowsObj
Script Source:
Imports System
Imports System.Data
Imports System.Math
Imports Microsoft.SqlServer.Dts.Runtime
Imports System.Xml
Imports System.Collections
Imports System.Data.OleDb
Public Class ScriptMain
Public Sub Main()
Dim oleDA As New OleDbDataAdapter
Dim dt As New DataTable
Dim col As DataColumn
Dim row As DataRow
Dim sMsg As String
oleDA.Fill(dt, Dts.Variables("vTableRowsObj").Value)
Dts.Events.FireInformation(-1, "START!!!!!!!!!!!!!!", "START LOOP", "", 0, True)
Dts.Events.FireInformation(1, "RowCount: ", dt.Rows.Count.ToString(), "", 0, True)
For Each row In dt.Rows
For Each col In dt.Columns
sMsg = sMsg & col.ColumnName & ": " & row(col.Ordinal).ToString & vbCrLf
Next
Dts.Events.FireInformation(1, "Msg: ", sMsg, "", 0, True)
sMsg = ""
Next
Dts.TaskResult = ScriptResults.Success
End Sub
End Class
BI and ERP Senior Consultant @ Nexum Bogazici
If it is, Please dont forget to mark as answered or at least vote as helpful if the post helps you in any ways. -
A Script to Find and Replace Layer Names
Are there any scripts to find and replace layer names?
There is an excellent script available for Photoshop which allows you to not only replace words in layer names, but also insert words as Prefixes, Suffixes and Sequential Numbers.
The illustrator version of this script only allows sequential numbering: It doesn't offer find and replacing of words.
Ideally, it would be great if there was something that could do multiple find and replaces in one go:
(e.g.
You have layers like this Car, Dog, Bat
You enter: car(Option1), dog(Option2), Bat(Option3)
Your layers then become: Option1, Option2, Option3).big_smile, that's a very good start! Step 1 of Learning How To Script is indeed, adjusting an existing simple script to make it do more complicated things. (And usually then "break something", which is also a required part of the process.)
You are correct in your observation this is repetitive stuff. For one or two different items that wouldn't be a problem, but in longer lists you soon get lost.
The usual way of working with find-change lists is to build an array:
var layernames = [
[ 'FHairBowlBoy *Hair', 'Hairboy1' ],
[ 'FHairCurlyafroBoy *Hair', 'Hairboy2' ],
[ 'FHairSpikyBoy *Hair', 'Hairboy3' ],
The general idea is to loop over all names, check if the current layer name is "layernames[i][0]" (the left column) and if so, rename it to "layernames[i][1]" (the right column). If you know how to write a loop in Javascript, then you can implement this right away.
However ..
A more advanced way to do this doesn't even need loop to over all layernames -- instead you can immediately "get" the correct name per layer! It's magic! Almost!
The trick is to use a Javascript object instead of an array. Javascript objects are nothing special; Illustrator's 'layers' is an array of objects, and each object "layer" has a property "name", whose value you can read and set. What I do here is create a new object, where the "name" part is the original layer name and its value is the new layer name. All you need to check for per each layer is if there is a property 'object.originalLayerName', and if so, assign its value to that layer name.
This looks a bit like the array above, except that (1) you use {..} instead of [..] to create an object, and (2) you add "name:value" pairs instead of "value" only (actually, the 'name' of a value in an array is simply its number).
So this is what it looks like:
// JavaScript Document
var doc = app.activeDocument;
// name indexed object
var layernames = {
'FHairBowlBoy *Hair':'Hairboy1',
'FHairCurlyafroBoy *Hair':'Hairboy2',
'FHairSpikyBoy *Hair':'Hairboy3'
// loop through all layers
for (var i = 0; i < doc.layers.length; i++)
//Set up Variable to access layer name
var currentLayer = app.activeDocument.layers[i];
if (layernames[currentLayer.name])
currentLayer.name = layernames[currentLayer.name];
Enjoy! -
Search for string and replace with frame break
Hello there,
We're using an InDesign CS6 Server for creating print data. The problem relates to our documents that consist of several connected text frames.
Situation:
The texts are exported from our database into InDesign via xml and so some automated editing in javascript. These texts contaion several paragraphs with headlines. Sometimes after the import the layout just looks bad, because the first textfield contains the fist paragraph and the headline of the second paragraph including some lines of text. Sometimes this behaviour is desired and sometimes not.
Workaroud:
We definde the string #*# to be our placeholder for line breaks. During the creation of the xml this string gets replaced by unicode for the hard line break (
).
Desired Solution:
This workaround has some disadvantages and we want our placeholder string to be translated to a frame break.
Until now I have neither found any definition for the unicode translation of the frame break nor a script based solution that just replaces this string with a frame break. any help is appreciated.
RegardsInstend of define string add attribute in xml or DB
e.g attribute name frame break="frame break"
after that through find the attribute get the insertion ponint and apply "SpecialCharacters.FRAME_BREAK" -
SQL 2008 R2 - SSIS C# Script Task - Not Setting Variable
OK... I am stumped. I am trying to set the variable "User::TicketDB_Get_SQL" from a Script Task since it is dynamic... and well it isn't working :(
I can see I am supposed to be setting the value, but when I do breaks and watch that variable the new value is not being set. Here is my C# code... Can someone look and see what the heck I might be doing wrong:
Microsoft SQL Server Integration Services Script Task
Write scripts using Microsoft Visual C# 2008.
The ScriptMain is the entry point class of the script.
using System;
using System.IO;
using System.Data;
using Microsoft.SqlServer.Dts.Runtime;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Text.RegularExpressions;
namespace ST_3542610d50a64788be84926d15e07f7b.csproj
[System.AddIn.AddIn("ScriptMain", Version = "1.0", Publisher = "", Description = "")]
public partial class ScriptMain : Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
#region VSTA generated code
enum ScriptResults
Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success,
Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
#endregion
public void Main()
//MessageBox.Show("Start VB");
//MessageBox.Show("Make ADO Connection");
SqlConnection sqlConn = new SqlConnection();
sqlConn = (SqlConnection)(Dts.Connections["ADO-DW-SSIS_Processing"].AcquireConnection(Dts.Transaction) as SqlConnection);
SqlConnection sqlTicketDBRowsConn = new SqlConnection();
sqlTicketDBRowsConn = (SqlConnection)(Dts.Connections["ADO-DW-SSIS_Processing"].AcquireConnection(Dts.Transaction) as SqlConnection);
//MessageBox.Show("Connected to ADO");
String newSelectSQL = null;
//bool fireAgain = false;
Variables vars = null;
try
Dts.VariableDispenser.LockForRead("User::Data_Warehouse_Max_Modified_Date");
Dts.VariableDispenser.LockForRead("User::Data_Warehouse_Prod_Table");
Dts.VariableDispenser.LockForRead("User::Modified_Date_Field");
Dts.VariableDispenser.LockForRead("User::TicketDB_Schema");
Dts.VariableDispenser.LockForRead("User::Table_Name");
Dts.VariableDispenser.LockForRead("User::Unique_ID_Field");
Dts.VariableDispenser.LockForRead("User::Data_Warehouse_Process_Table_Name");
Dts.VariableDispenser.LockForRead("User::Data_Warehouse_DB_Name");
Dts.VariableDispenser.LockForWrite("User::TicketDB_Get_SQL");
Dts.VariableDispenser.LockForWrite("User::Reprocess_Records");
Dts.VariableDispenser.GetVariables(ref vars);
//Dts.VariableDispenser.GetVariables(ref glvars);
String maxModDate = vars["User::Data_Warehouse_Max_Modified_Date"].Value.ToString();
String prodtable = vars["User::Data_Warehouse_Prod_Table"].Value.ToString();
String modField = vars["User::Modified_Date_Field"].Value.ToString();
String TicketDBSchema = vars["User::TicketDB_Schema"].Value.ToString();
String tablename = vars["User::Table_Name"].Value.ToString();
String uniqIDField = vars["User::Unique_ID_Field"].Value.ToString();
String procTable = vars["User::Data_Warehouse_Process_Table_Name"].Value.ToString();
String custName = vars["User::Data_Warehouse_DB_Name"].Value.ToString();
String Reprocess = "F";
String ReprocessDate = "0";
String ReprocessPrime = null;
String ReprocessVal = null;
Int16 count = 0;
#region Get List of Rows for TicketDB Query
String TicketDBRows = null;
String sqlTicketDBRowsQuery = "SELECT [TicketDB_Column_Name] " +
"FROM " + procTable + " " +
"WHERE " +
"[Import_Data_Warehouse] = 1 " +
"AND " +
"[TicketDB_Table_Name] = '" + tablename + "' " +
"ORDER BY [TicketDB_Column_Name]";
SqlCommand sqlTicketDBRowsCmd = new SqlCommand(sqlTicketDBRowsQuery, sqlTicketDBRowsConn);
SqlDataReader sqlTicketDBRowsReader = sqlTicketDBRowsCmd.ExecuteReader();
Int16 TicketDBrowcount = 0;
while (sqlTicketDBRowsReader.Read())
if (TicketDBrowcount > 0)
TicketDBRows += ", ";
TicketDBRows += " " + sqlTicketDBRowsReader.GetString(0) + " ";
TicketDBrowcount++;
#endregion
String Pattern = @"(\D)\s-\s(\d+)(\s-\s(.*)\s-\s(.*))?";
String ReProcessFile = null;
if (prodtable.Equals("Template")) {
ReProcessFile = "E:\\Templates\\Configs\\" + prodtable + "-Reprocess.txt";
else
ReProcessFile = "E:\\SSIS_Configs\\" + custName + "\\" + prodtable + "-Reprocess.txt";
#region Process Re-Process File
if (File.Exists(ReProcessFile))
//MessageBox.Show("File is found");
using (StreamReader sr = new StreamReader(ReProcessFile))
//MessageBox.Show("File has been opened");
string line;
while ((line = sr.ReadLine()) != null)
//MessageBox.Show("Found a Line: " + line);
Regex rgx = new Regex(Pattern, RegexOptions.IgnoreCase);
MatchCollection matches = rgx.Matches(line);
foreach (Match match in matches)
GroupCollection groups = match.Groups;
Reprocess = groups[1].Value;
ReprocessDate = groups[2].Value;
ReprocessPrime = groups[4].Value;
ReprocessVal = groups[5].Value;
//MessageBox.Show("Variables Set." + Environment.NewLine +
// "Reprocess: " + Reprocess + Environment.NewLine +
// "Reprocess Date: " + ReprocessDate + Environment.NewLine +
// "Reprocess Primary Field: " + ReprocessPrime + Environment.NewLine +
// "Reprocess Value Field: " + ReprocessVal);
//MessageBox.Show("End Processing File");
#endregion
#region Re-Proccess Rows
if (Reprocess.Equals("T"))
if (String.IsNullOrEmpty(ReprocessPrime) && String.IsNullOrEmpty(ReprocessVal))
else
//MessageBox.Show("Finished Getting Read Only Variables");
string sqlQuery = "SELECT TOP (1000) " + uniqIDField + " " +
"FROM " + prodtable + " " +
"WHERE " +
"[" + ReprocessVal + "] IS NULL " +
"AND " +
"[" + ReprocessPrime + "] IS NOT NULL " +
"ORDER BY [" + modField + "]";
//MessageBox.Show("sqlQuery: " + sqlQuery);
SqlCommand sqlCmd = new SqlCommand(sqlQuery, sqlConn);
SqlDataReader sqlReader = sqlCmd.ExecuteReader();
newSelectSQL = "SELECT " + TicketDBRows + " FROM " + TicketDBSchema + "." + tablename + " WHERE "; // + modField + " > '" + maxModDate + "' ";
while (sqlReader.Read())
if (count == 0)
newSelectSQL += " CASE_ID IN (";
if (count > 0)
newSelectSQL += ", ";
newSelectSQL += "'" + sqlReader.GetString(0) + "'";
count++;
newSelectSQL += ") OR " + modField + " > '" + maxModDate + "' ORDER BY " + modField + " ASC";
//sqlConn.Close();
if (count == 0)
//MessageBox.Show("Reprocess: " + Reprocess + Environment.NewLine + "Start Date: " + ReprocessDate);
newSelectSQL = "SELECT " + TicketDBRows + " FROM " + TicketDBSchema + "." + tablename + " " + "WHERE " + modField + " >= '" + ReprocessDate + "' ";
newSelectSQL += "ORDER BY " + modField + " ASC";
vars["User::Reprocess_Records"].Value = newSelectSQL.ToString();
//Dts.Variables["User::Reprocess_Records"].Value = "T";
else
//MessageBox.Show("NO Reprocess: " + Reprocess + Environment.NewLine + "Max Date: " + maxModDate);
newSelectSQL = "SELECT " + TicketDBRows + " FROM " + TicketDBSchema + "." + tablename + " " + "WHERE " + modField + " > '" + maxModDate + "' ";
newSelectSQL += "ORDER BY " + modField + " ASC";
#endregion
else
//MessageBox.Show("NO Reprocess: " + Reprocess + Environment.NewLine + "Max Date: " + maxModDate);
newSelectSQL = "SELECT " + TicketDBRows + " FROM " + TicketDBSchema + "." + tablename + " " + "WHERE " + modField + " > '" + maxModDate + "' ";
newSelectSQL += "ORDER BY " + modField + " ASC";
//MessageBox.Show("Maybe New SQL: " + newSelectSQL.ToString());
//Variables vars = null;
MessageBox.Show("Got Variable now lets set it to: " + newSelectSQL.ToString());
// Now you can use the variables
vars["User::TicketDB_Get_SQL"].Value = newSelectSQL.ToString();
MessageBox.Show("New SQL: " + vars["User::TicketDB_Get_SQL"].Value.ToString());
//vars.Unlock();
catch (Exception ex)
//MessageBox.Show("Error :(");
// Throw an exception or add some logging
//this.Dts.Events.FireInformation(1, "Something Went Wrong", newSelectSQL.ToString(), "", 0, ref fireAgain);
throw ex;
//Dts.TaskResult = (int)ScriptResults.Failure;
finally
//MessageBox.Show("Trying to UNLock Variable");
// Release the locks (even if your script task fails)
vars.Unlock();
//Dts.Variables["User::TicketDB_Get_SQL"].Value = newSelectSQL;
//MessageBox.Show("New SQL: " + Dts.Variables["User::TicketDB_Get_SQL"].Value);
Dts.TaskResult = (int)ScriptResults.Success;
So that is my code... when I run it, line # 217 shows what the new Variable should be... However when I hit line # 220 it isn't set and if I let it continue I am watching the variables and it isn't getting set. I am confused... anyone??
Billy S.Hi Billy S,
Thank you for sharing your solutions and experience here. It will be very beneficial for other community members who have similar questions.
Thanks,
Eileen
TechNet Subscriber Support
If you are
TechNet Subscription user and have any feedback on our support quality, please send your feedback
here -
Pass variables to child via C# script task ?
I don't want to use package configurations to pass variables from Parent to child package. I'd prefer to pass the variables to child, from a C# script task in the parent package. Can this be done ? Here is the pseudocode for what I hope to do -
//code in script task of parent package
Main(){
Object parentObj = SSIS.ParentPackage.myObject;
String parentStr = SSIS.ParentPackage.myString;
callChildPackage(parentObj, parentStr);You have four choices for this:
Use Parent-Child variable configurations
Place the value in a variable in the parent package, which can be referenced from the child package, when run with an Execute Package Task. (http://agilebi.com/jwelch/2009/10/03/passing-an-object-from-a-parent-package-to-a-child)
Take over the execution of the child package entirely executing the package from inside your C# script task.
Use something like the Task Factory Advanced Execute Package task. (Full Disclosure: I work for Pragmatic Works)
Item 3 is probably closest to what you want. You'd need to use the Package.Execute method to run the child package yourself. The advantage of doing that is you can set child package variables explicitly before executing the package.
John Welch | www.pragmaticworks.com | www.agilebi.com | ssisUnit.codeplex.com -
Creating an empty file using variable in script task
I created an empty file by writing a code in script task. how can i use a variable to do the same job.
System.IO.File.Create(@"C:\OneEmptyTextFile.txt");Hi SyedF,
Just as you said, we should refer to the code below to create an empty file in the specified path using System.IO.File.Create:
System.IO.File.Create(Path)
If we want to use a variable named FilePath to control the path of the created file, please refer to the following code:
Dim Path As String
Path = Dts.Variables("FilePath").Value
System.IO.File.Create(Path)
Reference:
https://msdn.microsoft.com/en-IN/library/ms135941.aspx
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
Variable of Type "Object" is getting Null in script task
I have 3 components as below
1. Execute Sql Task ---> It will fetch The data from Database using ConnectionType "OLEDB" ("Full Result Set" its returning) and Store it in the Variable as below,
"ConfigDetails" "Scope --> Package" "Type - Object".
2. Script Task (First) ----> Here "ConfigDetails" Variable is part of "ReadOnlyVariables", So i am accessing this varaible and populating data from it in the Data Table object as below,
OleDbDataAdapter configAdapter = new OleDbDataAdapter();
DataTable dtConfigurationList = new DataTable();
object config = Dts.Variables["ConfigDetails"].Value;
configAdapter.Fill(dtConfigurationList, config);
So here i am successfull in populating data in the data table .
3. Script Task (Second)--> Same thig i am doing in second script task also as "First"
Here "ConfigDetails" Variable is part of "ReadOnlyVariables", So i am accessing this varaible and populating data from it in the Data Table object as below,
OleDbDataAdapter configAdapter = new OleDbDataAdapter();
DataTable dtConfigurationList = new DataTable();
object config = Dts.Variables["ConfigDetails"].Value;
configAdapter.Fill(dtConfigurationList, config);
So here it will execute successfully without any error. But no data is there in the data table .
If i skip first script task, second script task is able to populate the data. But i am not righting any code to nullify the object and its part of "Read Only Varaibles."
So please help me what i am doing wrong.
configAdapter.Fill(dtConfigurationList, config);What do you pass to the config variable?
Arthur My Blog -
Query Variable - Replacement Path
Hi all,
I would need to fill a query variable (based on calendar week characteristic) with specific list of values. I need all calendar weeks that are present in infocube, but only if key-figure > 0. So I've created a query with cal. weeks in rows and with suppressed zero rows. Output values from query contains exactly what I need.
Than I created a variable (replacement path) with reference to mentioned query. But it seems to me that the variable does not contain all values displayed in the query, but only filtered values (if I use some restriction of cal. week).
Is it possible to achieve this using replacement path at all?
If not I would appreciate any idea or experiences how to accomplish this requirement.
Many thanks,
regards,
PavelHi Pavel, I didn't get your requirement 100% . Still, I would like to tell How Replacement path works.
First of all for the Source query you have given condition to restict the output of the query on particular keyfigure value > 0 ...... Right.
Now on second query, you have created the Characteristic variable with Replacement path....here some important things to look at.
while creating the variable, select Processing Type as REPLACEMENT PATH, then in the "Replacement path" Tab, give Replaced variable with.. "Query" ...and at bottom, For QUERY give the query name.
If u want RRI facility from Source Query to Target Query, then u give RRI Connection in T-Code : RSBBS....
...and now when u execute the Second Query, First the first Query will be executed and those filtered values > 0 will be passed to the Second Query's variable input...then the second query will be executed...
But, in your case check once again all settings in Variable in Second Query..and Conditions block in First Query..
It should definitely work...
---Intros.
Edited by: Intros on Apr 25, 2008 1:31 PM -
Preselection-variable (replacment-path: replacement with query)
Hello Expert's
Can you explain me, how we can set up a pre-query with characteristics and key figures.
e.g.
Due the performace reason in the olap process, we have the calculate a range of values before
in query 1. This query contains characteristics and key figures.
In the query 2 we've preselection-variable (replacment-path: replacement with query) to query 1.
My question is, how we can get also the key figures-values from query 1, to continue to use the values for query 2?
Thanks for feedbacks,
RegardsHi,
As this is the variable restriction and variable restrictions are not put on key figure values (except RKF). As I know you will not be able to get key figure values using replacemtn path with query.
Regards,
Durgesh. -
Offset in Variable Replacement Path
Hi gurus,
I have a 7.0 BI System.
I can't able to set an offset in a variable replace from query.
It's normal? Or I must to set some parameters to make it?
Thanks in advance.Hi,
What you exactly mean by variable replace - is it
Formula variable with processing by replacement path -If yes, then you can set the offset in the replacement path variable. when we create a replacement path variable then we do get the option for setting the offset. Please check that while creating a replacement path variable.
Thanks
Dipika -
Get an Alter XMLA string via C# script task
Hi,
I have an alter Database XMLA file that needs to be deployed to an Analysis Server only if there was a change with the existing database.
I have a C# script task that checks if the DB exists before deploying.
What I need to add, is code that compares the alter Database XMLA file with the existing DB metadata.
It would be good enough to get code example of how to extract the XMLA using AMO.Hi ,
Please refer the below link for sample code
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/5b17c421-699d-4dbf-849c-0531f4e0411e/extract-the-xml-form-dsv-and-cube-through-net
Best Regards Sorna
Maybe you are looking for
-
Hi, I need to integrate BI reports in portals.How to deploy Bex reports in portal.Please can u able to help me out in this issue. Regards, Laxmi.
-
Parts of masked line art and text appearing in PDF and (some) in InDesign files
Hello Adobe community, I was wondering if someone can shed any light on an issue (or possibly 2 issues) I am having. I am using CC on a Mac. Software versions are Illustrator CC 17.1, InDesign 10.1.0.71, Acrobat 11.0.07. Firstly in InDesign there is
-
How to create a shopping cart in JSP?
I am creating an online product ordering system, How can i create a shopping cart in jsp? is there a way i can save a table containg itemcode, price, quantity in jsp? Can i save it using bean or session? please help me. thanks in advance.
-
I am trying to download itunes 11.1.3. I cannot save the file,ItunesSetup.exe. I click on Save File and nothing happens, I use XP. The thank you page comes up right away
-
How to check, when the Maintenance Order was deleted
Hello Experts, Can you please tell me of how to check for the maintenance order that when it was deleted and who has deleted that. If any T-Code is there or at the Table level also to check the requirement. Regards, Yawar Khan