How can I make multiple variable value to replace EL expression one by one In Nifi? - el

I just know a single value can replacing EL expression
but idk how the result set replace EL one by one,as picture.
Any help is appreciated!

Thank #daggett again.ExecuteSql - SplitAvro - AvroToJson - EvaluateJSONPath (to put dynamic column name into ff attribute) - ExecuteSql(to set ${dynamic_column_name} for substituting sql query)

Related

Regex for extracting certain information from a string

Below is the string that I have -
vdp_plus_forecast_aucc_VDP_20221024_variance_analysis_20221107_backcasting_actuals_asp_True_vlt_True.csv
I need RegEx to take out following items from the string -
20221107
vlt_True
Need help with writing right RegEx for these two extractions. I'm performing the operation on a PySpark DF.
I'm assuming that the answer is based on the variable in front of it so it's capturing the value of variance analysis:
(?<=_variance_analysis_)[0-9]+|vlt_(True|False)
This should capture the variables you wanted, if you only need the value of vlt, you can replace vlt_ with (?<=_vlt) which will just capture the value without the variable

Qlikview -- Using If with a variable in expression

I am trying to use an if statement with a variable in my expression and I get no results. The variable works when I use the variable on it's own but when used with the if I get no results.
I have tried:
if(OrderQtr='Apr-Jun 2018',$(vAvgOrderCost),0)
if(OrderQtr='Apr-Jun 2018',sum($(vAvgOrderCost)),0)
sum($(vAvgOrderCost)if(OrderQtr='Apr-Jun 2018',0))
Nothing seems to work. Thanks
Variables in QlikView are used as a text replace feature, so be carefull. If your variable hold a value like 1,345 an expression like "if(OrderQtr='Apr-Jun 2018',$(vAvgOrderCost),0)" will be translated into "if(OrderQtr='Apr-Jun 2018',1,345,0)" which by itself will be a syntax error.
Something like :
Num(if(OrderQtr='Apr-Jun 2018','$(vAvgOrderCost)','0'))
would be a safe way to go.
the if() syntax should work like this if(test,true,false)
So looking at your examples I suspect this is what you are trying to do
sum(if(OrderQtr='Apr-Jun 2018',$(vAvgOrderCost),0))

Update command in sql having issue

I have below details in the table
GEMS#TEST1>select BUILTIN_ARGUMENTS from FND_FORM_CUSTOM_ACTIONS WHERE (RULE_ID = 2243);
BUILTIN_ARGUMENTS
--------------------------------------------------------------------------------
='http://prod.client.com:3001/ords/f?p=1:2:::NO::P_ORDER_HEADER_ID,P_SESSION
_ID:'||${item.ORDER.HEADER_ID.VALUE}||','||${ps.db_session_id.value}
For a need ,I have to update this "prod.client.com:3001" as
"test1-scan.client.com"
When I am executing below getting error
GEMS#TEST1>update FND_FORM_CUSTOM_ACTIONS set = '='http://test1-scan.client.com/ords/f?p=1:2:::NO::P_ORDER_HEADER_ID,P_SESSION
_ID:'||${item.ORDER.HEADER_ID.VALUE}||','||${ps.db_session_id.value}' WHERE (RULE_ID = 2243);
SP2-0552: Bind variable "NO" not declared.
GEMS#TEST1>
I know I might have to use escape character or declare the variable but not getting clue as I am not very good in coding .
Using REPLACE in this case is better.
UPDATE fnd_form_custom_actions
SET builtin_arguments = REPLACE (builtin_arguments, 'prod.client.com:3001',
'test1-scan.client.com')
WHERE rule_id = 2243 ;
You have obvious typos in your statement:
set = '='http://test1-scan.client.com/ords/f?p=1:2:::NO [.......]
set what = .....?
Then: what is with the second equal sign, in single quotes? (OR... I see - did you mean single quotes within the assigned string? You must enter TWO single quotes to represent one single quote in a string!)
Then: since the second equal sign consumes the single quotes, what follows AFTER it is not quoted. So :NO is seen as a bind variable. Correct the syntax and Oracle won't ask you about any bind variables.
With that fixed, look at Kaushik's answer for a better approach altogether.

Storing a Value of a Set analysis expression in a Variable

I am struggling with storing a set analysis expression's value in a variable.
I want to store below expression's value in a variable so that i can use that further for some calculations.
Min({< Data_Period = {'Weekly'},Formatted_Date = {'>$(=$(vSelectedWeek))'}>} Date,2)
The above expression works fine if i use it in a text box on a sheet tab. However, it is not working if i try to store its value in a variable and use that variable.
Set vW1 = Min({< Data_Period = {'Weekly'},Formatted_Date = {'>$(=$(vSelectedWeek))'}>} Date,2);
Here vSelectedWeek is being calculated as follows:
Set vSelectedWeek = Date(Weekstart(Only(BaseData_Date)),'dd/MM/YYYY');
Please advise if i am doing anything wrong or is there any other way around to achieve the same?
Thanks in advance.
If your var is truly working with that expression then try creating an input box object, define your var there and add the expression in the right column.
That should work.
If you find my answer to be pretty simple or not the way you want it, checking this link might help: https://community.qlik.com/thread/198307

Use single value of parameter List in queryString

I am using JasperStudio 5.6.0.final and the report is not generated dynamically from java code.
I have a problem with getting single value from parameter.
In the report I have a parameter A of a type List.
It is not a problem to use it in a clause as IN statement:
AND $X{IN, USER.ID_USER, A}
But I have a problem to get a single value from that list.
I know that my List has always 10 values.
So I want to use it in query, but I don't know how to write the statement:
AND USER.ID_USER = *first_value_of_list_A*
e.g.
AND USER.ID_USER = $P!{Atrybuty}.get(1)
doesn't work
I tried also to assign parameter value to a variable, but as I know it isn't possible to use variables in queryString.
So my question: How to get single value from parameter List in queryString.
What you need to do for this is use
AND $X{IN, USER.ID_USER, A}
Set A type as Collection and that will allow you to even have a single selection or multi selection or just a single value.
Hope that this helps.