Hi mikrom,
our environment is Windows environment hence .Net/C# would be the native language. Last time you gave us the c# solution I believe this time you can do it again :)
I will try gmmatros solution.
Hello C# gurus,
I am trying to split some of the data from one row into multiple rows with conditions.
in the data set, the original value of ActionType could be Changed, Added, or deleted.
The conditions of change are:
If ActionType = Changed, we must split it into 2 rows: ActionType =...
Hey Mikrom,
Do you mind showing the codes, I have put the thread on the other forum.
Hi Chris,
In a simple explanation, There are 2 datasets we need to match, dataset1 (the unmerged version) and dataset2 (the merged version).
Initially, I thought it would be better to match both datasets in a...
Hi Chris,
This is the other way around of the approach.
Previously, we would have liked to merge the original data and then match it with the other table.
but merging the data has a data quality issue hence we thought it would be better for another table to split than match with the original...
Hello SQL gurus,
I am trying to split some of the data from one row into multiple rows with conditions.
in the data set, the original value of ActionType could be Changed, Added, or deleted.
The condition of changes are:
If ActionType = Changed, we must split it into 2 rows : ActionType =...
Hi SQL guru,
We are trying to locate the client information that has been changed.
However, in our historical dataset, the change definition is deleted record and added record
Hence the original dataset is as below:
RowNumber ParentID ChildID IdentityCode ActionType Date
1 ABC...
I know, but I need to keep that flag because the company name may be the parents in different families and that flag is to dedup which one is the right ClientID.
I think I have found a solution by comparing it with the previous name...
Hi Mikrom,
We need some little enhancement in your codes.
if there was some not duplicated value after the duplicated, it should be the parents the one right above it, not the one with Manual Flag = 'y'
As per below example
Data like below
ROW_N FamilyID CompanyName HierarchyLevel ClientID...
Hello mikrom,
I am using drop tables as a workaround but we use quite number of volatile tables hence the codes look a bit messy.
In other language, we drop volatile tables by closing the session which looks simpler and more elegant 😊
Hi,
I have simple c# codes as below about executing the creation of some volatile tables in Teradata.
In Teradata, Volatile tables only remain within a session hence I would like to dispose of them to clear up memory before creating other volatile tables.
using (var connection = new...
Sorry mikrom, I was throwing a solution after I was talking to my stakeholders and yesterday tek-tips was down.
No, the basic data structure does not change. I just need to merge my reference table into the main table.
Hence to handle duplicate names, I just need to replace the column MatchRank...
Thanks Mikrom,
You are such a legend!
After discussion with our stakeholders, if the client names are duplicated, they do not want to pick based on the biggest deal only (match rank), there are other considerations.
Hence solution-wise, I will build a web front end for them to cherry-pick...
Sorry mikrom,
it was like Sunday after midnight when I typed this, so it has some typos.
We just received a new data set to handle duplicate company names.
In that case, they rank it for us to identify the client who has the biggest deal amount and flag it in MatchRank.
With match rank, then we...
Hi Mikrom,
I just realised the CLIENTID can be duplicated as the company name could be similar, we need to show the duplication in the child.
But when we choose the parent, we need to dedup it by the highest match rank.
For example below
ROW_N FamilyID CompanyName HierarchyLevel ClientID...
Hi Mikrom,
Great script, can you show me the output of this, please? if good, I would replicate this logic in c#/python.
I write awk as well but this is in windows ecosystem hence I would choose c#
Thanks,
Hello C# legends,
I have raw data with a family structure vertical as below
ROW_N FamilyID CompanyName HierarchyLevel ClientID
1 A XX1 0 A1
2 A XX2 1 A12
3 A XX3 2 A345
4 A XX4...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.