Informatica Parameter String - informatica

I have a question:
I have a parameter file with:
$$DEPARTMENTS_1 = 'ITS','FINAN','RHM','OP'
$$DEPARTMENTS_2 = 'TECH','BI','FIELD','MECH'
I use the parameter in the source qualifier and it work fine
SELECT NAME,PAY,EMPLOYEE_DEPART
FROM HR_DB
WHERE EMPLOYEE_DEPART IN ($$DEPARTMENTS_1,$$DEPARTMENTS_2)
But, In need to use in mapping to use in expression:
DECODE(TRUE,
IN(EMPLOYEE_DEPART,$$DEPARTMENTS_1),'DEPARTMENT-1',
IN(EMPLOYEE_DEPART,$$DEPARTMENTS_2),'DEPARTMENT-2','NO-DEPARTMENT')
Gave me NO-DEPARTMENT to all my records.
How I can pass the string list to use in the DECODE.

You have to use mapping parameter and assign the parameter values. Post that use the parameter in the decode.
Go through these documents,
https://docs.informatica.com/data-integration/powercenter/10-2/designer-guide/mapping-parameters-and-variables/mapping-parameters-and-variables-overview.html
https://www.guru99.com/mappings-informatica.html

Related

Including parameter expression

I'm new in Informatica PowerCenter, trying to use a new declared parameter expression in Workflow Session parameter file.
Objective: the expression is being feed automatically from data base, so the reason behind all this is to be able to change the logic in db, parameter file will re-generate in the next run with the new logic which ultimately will cause not to change nothing in power Center, only record expression in db. Off course for new fields you will need to change informatica.
Let me summarize or try to be deatailed as posible.
Parameter file has no issues, when executing the workflow it's being read with out issues, here's an example of the parameter expression I'm trying to use (rest of them, dbCon, time etc i delete them)
[Example.WF:Example.WT:.ST:Example]
$$Param_checker=IIF(1=1,'A','B')
Mapping
Created the parameter in the mapping as:
Name: $$Param_checker
Type: Parameter
Data Type: String (as per doc)
Precision: 10000 <-- making sure there's no cut
IsExprVar: true
Created a field in a Transformation Expression Box (the violet one) as:
Name: out_param_checker
Data Type: String
Precision: 10
O: X
Expresion: $$Param_checker
Workflow
In it session reads correctly the parameter file of the Mapping replaces all variables but when it comes to $$Param_checker it's not being expanded, this is a sample of log outcome when inserting on data base (cast and allfunctions are done by Inf. aut.:
CASE WHEN CAST('$$Param_checker' AS VARCHAR(4000))
And off course in Data base when process finishes I see the string as well '$$Param_checker'
Just in case, and sorry for being verbose, I do already have a parameter with a expression working but in a source Qualifier using it on a SQL statement.
The issue is why can't I use it in a out field. Forgot to mention that we have redshift under the hood, all sessions are set to "Full" Optimization, hence I think that's the issue.
If anyone have any hint would appreciate it.
Thanks

We can’t parse this SQL syntax shows up in AWS Quicksight after applying toString()

I have a calculated field which computes a total based on a particular type:
sumIf(amount, type = "sale")
Now I'm trying to convert the result to string and then concatenate some text to it, but doing toString(sumIf(amount, type = "sale")) gives the following message:
We can’t parse this SQL syntax. If you are using custom SQL, verify the syntax and try again. Otherwise, contact support.
Is there any way to make this work?
Did you try using the correct bracket type? i.e.
toString(sumIf({amount}, {type} = "sale"))
I tried an example like this and that worked fine, Quicksight can have issues when calling fields without the right brackets.

Google Cloud Data Fusion - Dynamic arguments based on functions

Good morning all,
I'm looking in Google Data Fusion for a way to make dynamic the name of a source file stored on GCS. The files to be processed are named according to their value date, example: 2020-12-10_data.csv
My need would be to set the filename dynamically so that the pipeline uses the correct file every day (something like this: ${ new Date(). Getfullyear()... }_data.csv
I managed to use the arguments in runtime by specifying the date as a string (2020-12-10) but not with a function.
And more generally is there any documentation on how to enter dynamic parameters with ready-made or custom "functions" (I couldn't find it)
Thanks in advance for your help.
There is a readymade workaround, you can give a try "BigQuery Execute" plugin.
Steps:
Put below query in SQL
select cast(current_date as string) ||'_data.csv' as filename
--for output '2020-12-15_data.csv'
Row As Arguments to 'true'
Now use the above arguments via ${filename} wherever you want to.

How to use a query as a parameter for a function?

I just refactored into a power query function some code that process tables that has an specific structure.
Now, I need to pass another PowerQuery query (that returns a table with a compatible structure) to this function, but the parameter manager only allows to use strings, therefore I need to obtain access to the referenced table using an string with its name.
Any hints?

Changing parameter values inside a loup

I have created a parameter to report values after each instance solve in an iterative program.I wan't my parameter to be indexed by the set that defines the number of iteration and have two other free indexes like so:
model.report=Param(model.iter,[],[])
I then wan't to create a function,that will be called into a while loop and that will create my model,solve an instance and give some values to some variables, whose names will be used as indexes in my report parameter, like so:
report(model.iter,'cost',model.i)=model.cost[i]
Where model.cost is my cost variable indexed by set i.
Is it possible to do that?
You are better off simply making model.report a Python dict. Then you can assign it entries with whatever keys you like:
model.report = dict()
...
for j in range(10):
# assumes model.i is a simple built-in type and not a Param
# (otherwise you would need to use model.i.value)
model.report[j,'cost',model.i] = model.cost[j]
There is no reason to use a Param in this context unless you are using those values in some kind of expression and you want to be able to update the expression at a later time by changing the value of the Param (i.e., you would use mutable=True when you declare the Param).