Forum Discussion
Regroup Values to make less objects showed in Column Legend?
- 4 years ago
kuma
I hope this is what you're looking for https://www.dropbox.com/t/hj5rU1wIXUuMrtCX
Hi kuma
Here is a sample file with the solution https://www.dropbox.com/t/Ao5d3OS12zT88mDT
This is a general formula of a new column that removes the number (regardless of how many digits) from the end of the name
New Name =
VAR NameColumn = Data[name]
VAR Length1 = LEN ( NameColumn )
VAR NumericDigits = SELECTCOLUMNS ( GENERATESERIES ( 0, 9, 1 ), "@Digit", [Value] & "" )
VAR T1 = GENERATESERIES ( 1, Length1, 1 )
VAR T2 = ADDCOLUMNS ( T1, "@Letter1", IFERROR ( MID ( NameColumn, [Value], 1 ), BLANK ( ) ) )
VAR T3 = ADDCOLUMNS ( T2, "@Letter2", IF ( [@Letter1] IN NumericDigits, BLANK ( ), [@Letter1] ) )
VAR NewText = CONCATENATEX ( T3, [@Letter2] )
VAR Length2 = LEN ( NewText )
RETURN
LEFT ( NewText, Length2 - 1 )
Hi @tamerj1
Thank you for the solution.
Actually in the name field there is a more complex pattern than I exampled.
There are four pattern below:
1.MC_[ResourceGroup name]-RESOURCES_[instanceID]_[Reigion]
be like: MC_Corp-Platforms-RESOURCEGROUP-01-RESOURCES_AKSDEVTEST01_USEAST2
2.databricks-rg-[instanceID]-[SubResourceGroupID]
be like: databricks-rg-ADBDevTest01-8vcbrmn9wnqks
3.[Main Resource Group name]
be like :Corp-Platforms-RESOURCEGROUP-01
4.Others
What I want is:
a.regroup all objects in No.1 and display a name by [AKS] in legend.
b.regroup all objects in No.2 and display a name by [ADB] in legend.
c.keep all [Main Resource Group name] which has [Corp-Platforms]prefix in No.3,and display the values in legend.
d.do not display [others] in No.4.
Could you tell me how to achieve this?
Thank you very much.
- tamerj14 years ago
Community Champion
Hi kuma
Little confused. Would you please have the four examples in a table showing nput in one column and output in the other columnInput Output MC_Corp-Platforms-RESOURCEGROUP-01-RESOURCES_AKSDEVTEST01_USEAST2 ? databricks-rg-ADBDevTest01-8vcbrmn9wnqks ? Corp-Platforms-RESOURCEGROUP-01 ? "Others" ? - kuma4 years agoNew Member
Hi @tamerj1
Here are the examples what I want to get values output in the new column.
Please tell me how to archieve this,
Thank you very much.
Input Output MC_Corp-Platforms-RESOURCEGROUP-01-RESOURCES_AKSDEVTEST01_USEAST2 AKS databricks-rg-ADBDevTest01-8vcbrmn9wnqks ADB Corp-Platforms-RESOURCEGROUP-01 Corp-Platforms-RESOURCEGROUP-01 "Others" Others
- tamerj14 years ago
Community Champion
kuma
I hope this is what you're looking for https://www.dropbox.com/t/hj5rU1wIXUuMrtCX