Best Of
Re: Percent of Series?
First, I don't think that's an overlay bar, because there's no option label totals in an overlay bar.
But if you were using an overlay bar, MichelleH is right that the best approach would be a BeastMode and a tooltip. It's an unusual percentage to get, but I think if you're using an overlay, I agree, it's what you want. Here's a BeastMode that gives the total for Blue and then Green/Blue for not Blue. Since we're mixing whole numbers and percents, I did the formatting in the BM, too:
Graphed as an overlay:
Re: Two Group By with SUM totals
You should be able to take the solution we did for Project Count with these changes:
1. Rename "ProjectId Const" tile to "Cost Const", name the constant "Planned Cost" instead of "Project Id", and make it zero instead of negative one.
2. In the Group By, do a Sum of "Planned Cost" instead of a Count Distinct of "Project Id".
3. Delete the "Correct for Dummy" tile, it isn't necessary (since our "dummy" is a cost of zero, which doesn't affect the sum at all so it doesn't need to be corrected).
rco
Re: Count that accomodates NULL
@PJG You will need to add IFNULL around every value in your beast mode to force nulls to zero like this: IFNULL(Value1,0) + IFNULL(Value2,0) + …
Re: How to filter column by a specific language
Hello @Mansa_TCC,
If the title in Portuguese or Spanish contains only standard English letters, this might be why you can't filter them.
This can be done with Domo Jupyter if you have access to this function.
Here is the script:
pip install langdetect
from langdetect import detect
#Function to detect language
def detect_language(title):
try:
return detect(title)
except LangDetectException:
return 'Unknown'
#Apply the function to create the 'Language' column
sample['Language'] = sample['title'].apply(detect_language)
#Display the DataFrame with the new column
sample
Here is the result:
You can then write to the dataset with the new column.
I can't think of any other solution. Unfortunately, I don't see 'langdetect' as part of the Python in ETL and you can't do it from there. If you need, I can help you with the rest of the steps.
Re: Logic - link original submit date to all subsequent back orders
Hello @Jbrorby ,
I had a similar problem to solve in the past. I was able to do it with a Python script in ETL:
Here is the result table:
Copy and past this in your ETL to find the solution and the Python script:
{"contentType":"domo/dataflow-actions","data":[{"icon":"python","name":"Python Script","category":"scripting","description":"Write a custom Python script to manipulate your data","helpUrl":"/articles/360045485833#1.","type":"PythonEngineAction","feature":"dataflows-scripting-python","config":{"curView":"configuration","hasSources":true,"hasTargets":true,"buttons":[{"id":"CODE_TEMPLATE","text":"Use code template","icon":"term"},{"id":"RUN_PREVIEW","text":"Run Preview","icon":"play-circle-outline"},{"id":"CANCEL_PREVIEW","text":"Cancel Preview","icon":"x-circle-outline"}]},"dirtyPreview":false,"previewRunning":false,"validationRunning":false,"removeByDefault":true,"configured":true,"ready":true,"enabled":true,"selectedTabHasMessage":false,"dependsOn":["ed1a6969-2fb0-49e9-a286-afc0dce95311"],"children":["8560b80c-e7e1-48b3-b20b-ecbd544bdd01"],"outputSchema":[{"name":"submitted at","id":"submitted at","type":"DATETIME","typeLabel":"Timestamp","icon":"icon-calendar-simple","metadata":{}},{"name":"order id","id":"order id","type":"LONG","typeLabel":"Integer","icon":"icon-numbers","metadata":{}},{"name":"original order id","id":"original order id","type":"LONG","typeLabel":"Integer","icon":"icon-numbers","metadata":{}},{"name":"first order","id":"first order","type":"LONG","typeLabel":"Integer","icon":"icon-numbers","metadata":{}}],"previewData":{},"gui":{"x":204,"y":48,"color":null,"colorSource":null,"sampleJson":null},"notes":[],"fillMissingWithNull":true,"additions":[{"name":"submitted at","dataType":"DATETIME"},{"name":"order id","dataType":"LONG"},{"name":"original order id","dataType":"LONG"},{"name":"first order","dataType":"LONG"}],"script":"# Import the domomagic package into the script\nfrom domomagic import *\nimport pandas as pd\nimport numpy as np\n\n# read data from inputs into a data frame\ninput1 = read_dataframe('Domo Forum Answer')\n\n# write your script here\n\nrelations = {}\n\nfor index, row in input1.iterrows():\n order = row['order id']\n replacement = row['original order id']\n if not pd.isna(replacement):\n relations[order] = replacement\n\n# Function to find the first order in a gives series of orders\ndef find_first_order(order):\n first_order = order\n while order in relations:\n first_order = order\n order = relations[order]\n return first_order\n\n \n# Create a new column 'first order' in the DataFrame\ninput1['first order'] = input1['order id'].apply(find_first_order)\n\n# write a data frame so it's available to the next action\nwrite_dataframe(input1)","condaEnv":null,"id":"07446cf8-e2c6-4a26-ba22-a532e3d4493d","settings":{},"label":"Python Script"},{"icon":"join-left-outer","name":"Join Data","category":"combine-data","description":"Combine rows from two DataSets into one.","type":"MergeJoin","helpUrl":"/articles/360044876194#3.","config":{"curView":"configuration","maxTargets":2,"minTargets":2,"hasSources":true,"hasTargets":true},"dirtyPreview":false,"previewRunning":false,"validationRunning":false,"removeByDefault":false,"configured":true,"ready":true,"enabled":true,"selectedTabHasMessage":false,"dependsOn":["07446cf8-e2c6-4a26-ba22-a532e3d4493d","ed1a6969-2fb0-49e9-a286-afc0dce95311"],"children":["c7f25cef-2c99-4d7c-8009-d4c4e34fe816"],"outputSchema":[{"name":"submitted at","id":"submitted at","type":"DATETIME","typeLabel":"Timestamp","icon":"icon-calendar-simple","metadata":{}},{"name":"order id","id":"order id","type":"LONG","typeLabel":"Integer","icon":"icon-numbers","metadata":{}},{"name":"original order id","id":"original order id","type":"LONG","typeLabel":"Integer","icon":"icon-numbers","metadata":{}},{"name":"first order","id":"first order","type":"LONG","typeLabel":"Integer","icon":"icon-numbers","metadata":{}},{"name":"NEW_COLUMN","id":"NEW_COLUMN","type":"DATE","typeLabel":"Date","icon":"icon-calendar-simple","metadata":{}}],"previewData":{},"gui":{"x":312,"y":132,"color":null,"colorSource":null,"sampleJson":null},"notes":[],"step1":"07446cf8-e2c6-4a26-ba22-a532e3d4493d","step2":"ed1a6969-2fb0-49e9-a286-afc0dce95311","joinType":"LEFT OUTER","keys1":["first order"],"keys2":["order id"],"on":null,"schemaModification1":[],"schemaModification2":[{"name":"submitted at","rename":"NEW_COLUMN","remove":false},{"name":"order id","rename":"Domo Forum Answer.order id","remove":true},{"name":"original order id","rename":"Domo Forum Answer.original order id","remove":true}],"relationshipType":"MANY_TO_MANY","id":"8560b80c-e7e1-48b3-b20b-ecbd544bdd01","settings":{},"label":"Join Data"}]}
Re: Sub-Category of a Category?
Thanks for the info - After posting this question and working through the process, I got to the point where I thought of just about the same solution. Thank you for confirming to me that this was in fact the way!
damen
Re: Click to select, not deselect
You can do this with quick filters. Click Select All for the quick filter in analyzer view and then save the card. All data will still be shown and once one is selected, it will filter for that value.
Re: How to Join two Group By without matching pair column
You could add phase totals by adding another branch of the original input with its own Group By, grouping by only Phase and doing a Count Distinct on Project Id called Total Project Count, and then Join that branch back in to your final result using Phase on both sides as the join key.
rco










