I have to work on transformation
Can anyone help me on writing a query for the below transformation
Source Column name (from lookup)
Source table (local_usr_tbl)
Lookup_1:(rpt_user_tbl)
INPUT CON_NUM,ML_SYMBL
MATCH CONDITION NBR = CON_NUM AND SYMBL = ML_SYMBL1
Output SYMBL
TRANSFORMATION LOGIC::
IIF(ISNULL(SYMBL), IIF(ISNULL(SYMBL1), ML_SYMBL1, SYMBL1), SYMBL )
Target Column name ML_SYMBL1(rpt_remote_table)
Please explain me how to make this transofrmation.I have all the other columns as direct move.Please help me out
This query might help you in testing :
select rpt_remote_table.ML_SYMBL1,local_usr_tbl.ML_SYMBL from local_usr_tbl, rpt_remote_table where local_usr_tbl.SYMBL is null and local_usr_tbl.SYMBL1 is null
Related
I have a select input with multiple options and my Mongo query
Here is the array if elements:
c<- c("elen","shallen")
query1 <- paste0('{"client": {"$in"["',c,'"]}')
#sales info is the data base
salesinfo$find(fields = '{"store":true,"_id":false}',query = query1)
Error: Invalid JSON object: {"client": [ elen ]}{"client": [ shallen ]}
this isn't working please help me please remember that it is a dynamic array and the values will change
After extensive research i found a way to solve the issue and i hope my solution will help out guys like me.
q1=paste(shQuote(c, type="cmd"), collapse=", ")
this step is to ensure you print out the array as a string and then use the query
query =paste0('{"store":{"$in":[',q1,']}}')
and the next step would be incorporating it to the query
salesinfo$find(fields = '{"store":true,"_id":false}',query = query)
Hei guys! I need help in a python program. I wanna make a method which returns the sum of the keys as a dictionary. But I get a error "object is not iterable".
def totaltAntallSalg (dic) :
s = sum (dic.keys)
return s
call_function = totaltAntallSalg({"Ahmed":2,"Nada":1, "hala":3 })
How can I solve this problem?
thanks in advance
How can you add strings ? It might be values that you want to add.
To add values you may use following code:-
def totaltAntallSalg(dic):
D={}
D['sum']=sum(dic.values())
return D
I try to group by my customize movieLense dataset
groupBy<- data.table(unifiedTbl)
x<- groupBy[,list(rating=sum(rating)
,Unknown=sum(unknown)
,Action=sum(Action)
,Adventure = sum(Adventure)
,Animation = sum(Animation)
,"Children's" = sum(Children's)
),by=list(user_id,age,occupation)]
but because of Children's I received some error which related to specified character
If I remove below part of my code every things is OK
,"Children's" = sum(Children's)
Now my question is how can I address to this column with full name?
how can I fix my codes?
You can use backticks with names that aren't valid syntax:
`Children's` = sum(`Children's`)
And of course, I'd recommend creating valid names instead:
setnames(groupBy, make.names(names(groupBy)))
I am new to graph databases and OrientDB, so I appreciate your patience.
I have the following SQL query to produce an expanded set of results for the shortest path between two vertices (I am using the GratefulDeadConcerts database):
select expand(sp) from (select shortestPath(#9:2,#9:15,'BOTH') as sp)
For whatever reason, using expand without aliasing produces no results, but that isn't really an issue.
What I want is not the shortest path, but a collection of potential paths and branches.
I have tried playing with travesedVertex:
SELECT traversedVertex(-1) FROM ( TRAVERSE out() FROM #9:2 WHILE $depth <= 10 )
But I don't know how to set the destination, or (honestly) how to interpret the results I get.
EDIT
If there are multiple ways to get from A to B, I want each of those paths returned as a set, something like:
{
paths: [
[#9:2, #4:16, #8:7, #9:15],
[#9:2, #4:2, #16:5, #11:3, #9:15],
[#9:2, #4:4, #11:6, #9:15]
]
}
Thank you for your help.
First, $path is the string representation of the current path.
Second, you can filter on the destination columns on the where clause of the outer query. Try this :
SELECT
$path
FROM
( TRAVERSE
out()
FROM
#9:2
WHILE
$depth <= 10 )
WHERE
#rid = #9:15
I get the following output :
Is this what you are looking for ?
If I don't add the where clause, I get this output :
I have a question and maybe somebody can help me figure out what the best way would be to achieve the solution. What i wanted to do is the reverse of:
http://doc.silverstripe.com/framework/en/topics/datamodel#highlighter_745635
WHERE ("LastName" = 'Minnée' AND ("FirstName" = 'Sam' OR "Age" = '17'))
I want to get something along the lines of:
WHERE( ("LastName" = 'Minnée') OR ("FirstName" = 'Sam' AND "Age" = '17'))
Now i cannot find any way to achieve this effect seeing as i cannot add a filter within the filterAny
For now i am doing it with the get()->where( ... ) option but was more wondering with this question if their are alternative options without having to write normal SQL code.
As 'AND' has a higher priority it doesn't need to be in braces. You can just write it as:
WHERE( "LastName" = 'Minnée' OR "FirstName" = 'Sam' AND "Age" = '17')
But as far as I can tell on the first look there isn't a way to write this without using where(). Let us know if you find a way. For debuging you can display the generated SQL-Query by calling the function sql():
... get()->where( ... )->sql();