infomatica unconnected lookup invalid symbol reference error - informatica-cloud

I am getting invalid symbol reference for below expression in informatica cloud
decode(true,STAGE_NAME_CODE='S1',:LKP.Lkp_SFDC_description(CODE),0)
in the unconnected lookup i have three fields code,code_type and description, I want to return description for stage_name_code from source file from the unconnected lookup field Code
but he onlytime the expression is valid is when its written like this..
decode(true,STAGE_NAME_CODE='S1',:LKP.Lkp_SFDC_description(STAGE_NAME_CODE))

Rather than using DECODE, you can use IIF function.
IIF(STAGE_NAME_CODE='S1',:LKP.Lkp_SFDC_description(STAGE_NAME_CODE))
This provides you an exact result.
To have fun on ETL, play with https://etlinfromatica.wordpress.com/

Related

How to perform parameterized date comparison with Azure Data Factory mapping data flows?

In mapping data flows I'm using the following filter expression against a late binding (schema drift) source:
toString(byName('modifiedon')) > '2022-04-19 00:00:00'
The filter expression returns the correct output. However I run into problems when I attempt to parameterize the expression using the following parameters:
For example, let's replace 'modifiedon' with a string type parameter as shown below:
toString(byName($WatermarkColumnName)) > '2022-04-19 00:00:00'
This will give me no output at all. If I try to parameterize the timestamp with a string type parameter I'll get the following error message when attempting data preview:
Incompatible data types between declared type and actual parameter value
I have tried defining the WatermarkValue parameter as TimeStamp and then using toString($WatermakValue) function in the filter expression but then it returns all records instead!

Why fn:substring-after Xquery function could not be used inside ML TDE

In my ML db, we have documents with distributor code like 'DIST:5012' (DIST:XXXX) XXXX is a four-digit number.
currently, in my TDE, the below code works well.
However instead of concat all the raw distributor codes, I want to simply concat the number part only. I used the fn:substring-after XQuery function. However, it won't work. It won't show that distributorCode column in the SQL View anymore. (Below code does not work.)
What is wrong? How to fix that?
Both fn:substring-after and fn:string-join is in TDE Dialect page.
https://docs.marklogic.com/9.0/guide/app-dev/TDE#id_99178
substring-after() expects a single string as input, not a sequence of strings.
To demonstrate, this will not work:
let $dist := ("DIST:5012", "DIST:5013")
return substring-after($dist, "DIST:")
This will:
for $dist in ("DIST:5012", "DIST:5013")
return substring-after($dist, "DIST:")
I need to double check what XPath expressions will work in a DTE, you might be able to change it to apply the substring-after() function in the last step:
fn:string-join( distributors/distributor/urn/substring-after(., 'DIST:'), ';')

Kusto extract text between string

Am trying to use regex to extract a string between a set of strings. But Kusto complains about the regex expression as invalid.
Am trying to replicate the expression from this link in my kusto query.
traces
| where ....
| project extract_all(#"(?<=This is)(.*)(?=sentence)", message)
Kusto would complain this error..
Relop semantic error: 'extractall' has the following semantic error: SEM0420: Regex pattern is ill-formed: (?<=This is)(.*)(?=sentence).
If issue persists, please open a support ticket. Request id: 01b819be-2e11-4983-9312-30f946c07afb
Could someone please help me fix the syntax of the above regex for kusto?
as the error message suggests, the regular expression you're specifying as the argument to the extract_all() method is invalid.
from the documentation: https://learn.microsoft.com/en-us/azure/data-explorer/kusto/query/re2
The regular expression syntax supported by Kusto is that of the re2 library.
If you were to provide a sample input and the matching expected output, it'd be easier to provide you with a functional and efficient solution.

How to access map in template string?

I want to use values from gradle.properties that should go into a template string.
A naive first:
println("${project.properties[somekey]}")
doesn't work: Unresolved reference: somekey
So, quotes required?
println("${project.properties[\"somekey\"]}")
is completely broken syntax: Expecting an expression for the first .
I couldn't find any example how to do this, yet the official documentation says expressions.
Question: is it possible to access a map in string template, and if so, how?
Yes and as follows:
"${project.properties["someKey"]}"
assuming the Map has the following signature: Map<String, Any?> (or Map<Any...)
Alternatives:
"${project.properties.getValue("someKey")}"
"${project.properties.getOrElse("someKey") { "lazy-evaluation-default-value" }}"
"${project.properties.getOrDefault("someKey", "someFixedDefaultValue")}"
Basically all the code you put in the ${} is just plain Kotlin code... no further quoting/escaping required, except for the dollar sign $ itself, e.g. use "\$test" if you do not want it to be substituted with a variable named test or """${"$"}test""" if you use a raw string
Note that in this println case the following would have sufficed as well (which also goes for all the shown alternatives above. You may omit the outer surrounding quotes and ${} altogether):
println(project.properties["someKey"])
See also Basic types - String templates

Programmatically getting a list of variables

Is it possible to get a list of declared variables with a VimL (aka VimScript) expression? I'd like to get the same set of values that will be presented for a command using -complete=expression. The goal is to augment that list for use in a user-defined command completion function.
You can use g: as a dictionary that holds all global variables, so:
let globals = keys(g:)
will give you all the names. The same applies to the other scopes: b:, s:, w:, etc. See :help internal-variables for the complete list.
You can get something similar using keys of g:, b:, t:, w: and v: dictionaries, but beware of the following facts:
There is no equivalent to this dictionaries if you want to complete options.
Some variables like count (but not g:count or l:count), b:changedtick and, maybe, others are not present in this dictionaries.
Some vim hacker may add key ### to dictionary g:, but it won't make expression g:### valid variable name (but adding 000 there will). Though g:["###"] will be a valid expression.

Resources