Need help with specific code that is not working in either beast mode or magic etl formula tile
Hi the following code I am using as a filter on my card and have it set to "on list" its called skus to be purged
"CASE
WHEN On Order
= 0
AND (Future Demand
= '' OR Future Demand
IS NULL)
AND (Future Books
= '' OR Future Books
IS NULL)
AND (Reserved
+ WMAVAIL
<= 10 AND WMAVAIL
> 0)
AND WAREHOUSE_CODE
= 11
THEN 'On List'
ELSE 'Not On List'
END"
I have one more beast mode calculation called FBA/WFS that is not a filter but a field within my card itself I have created this calculation to identify whether or not the SKU coming in this filtered list is also in warehouse 18 or 19. Here is the code for
"CASE
WHEN SUM(CASE WHEN WAREHOUSE_CODE
IN (18, 19) THEN 1 ELSE 0 END) > 0
THEN 'Exists'
ELSE 'Does Not Exist'
END"
When I bring this FBA/WFS field into my card I am only getting "does not exist" I know my original filter for SKUs to be purged only has warehouse code 11 coming in and in my dataflow I am grouping by on SKU and warehouse code to get one SKU and one warehouse code per line. Is there any way where I can use the filter for SKUs to be purged which is filtering on warehouse 11 only but can also see if any of those SKUs from warehouse 11 are in warehouses 18 and 19 because there are SKUs with warehouses 11, and 18 and 19 in the dataset itself but not sure how I can display it on the card. I have also tried to add a formula in the magic ETL formula tile but that didn't work as well.
Answers
-
I think you can do this with a FIXED function: https://domo-support.domo.com/s/article/4408174643607?language=en_US
It always takes me at least three attempts before I correctly write a FIXED function, so this probably won't work out of the box, but it will be something like this:
CASE
WHEN SUM(CASE WHEN
WAREHOUSE_CODE
IN (18, 19) THEN 1 ELSE 0 END) FIXED(BYWAREHOUSE_CODE
FILTER NONE) > 0THEN 'Exists'
ELSE 'Does Not Exist'
END
Please 💡/💖/👍/😊 this post if you read it and found it helpful.
Please accept the answer if it solved your problem.
0 -
Because I'm so bad with FIXED formulas, I would personally probably approach this at the ETL step. If you do your FBA/WFS in the ETL before filtering the "On list", it should work.
Please 💡/💖/👍/😊 this post if you read it and found it helpful.
Please accept the answer if it solved your problem.
0 -
CASE
WHEN SUM(CASE WHEN
WAREHOUSE_CODE
IN (18, 19) THEN 1 ELSE 0 END) FIXED(BYWAREHOUSE_CODE
FILTER NONE) > 0THEN 'Exists'
ELSE 'Does Not Exist'
END
When I am using this calculation in beast mode I am receiving this error "An issue has occurred during processing. We are unable to complete the request at this time - 'undefined'"
Do you know where I would do this in magic ETL I tried the same calculation in the formula tile and it gave me this error "Syntax error in expression at character 65 on line 4: FIXED"
0 -
@Utz Fixed functions require the aggregate function to be listed twice like this:
CASE WHEN SUM(SUM(CASE WHEN
WAREHOUSE_CODE
IN (18, 19) THEN 1 ELSE 0 END)) FIXED (BYWAREHOUSE_CODE
FILTER NONE) > 0 THEN 'Exists' ELSE 'Does Not Exist' ENDAlso note that you can only use FIXED functions in Beast Mode, not Magic ETL. If you wanted to accomplish the same thing in ETL you can use the following steps:
- Use a Group By tile, grouped by warehouse code to find the sum
- Join the Group By back to the previous tile on warehouse code to add the summed column to the rest of the data
- Use a Formula tile for the rest of the case statement (this last step can be done in beast mode as well)
0 -
According to the FAQ for Fixed functions, they can't be used to filter a card. I recommend going the ETL route that @MichelleH suggested instead
0 -
Thank you for the help appreciate it will give this a shot
0
Categories
- All Categories
- 1.9K Product Ideas
- 1.9K Ideas Exchange
- 1.6K Connect
- 1.3K Connectors
- 303 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 3K Transform
- 104 SQL DataFlows
- 640 Datasets
- 2.2K Magic ETL
- 4K Visualize
- 2.5K Charting
- 769 Beast Mode
- 72 App Studio
- 43 Variables
- 718 Automate
- 185 Apps
- 462 APIs & Domo Developer
- 57 Workflows
- 14 DomoAI
- 40 Predict
- 17 Jupyter Workspaces
- 23 R & Python Tiles
- 402 Distribute
- 116 Domo Everywhere
- 277 Scheduled Reports
- 9 Software Integrations
- 135 Manage
- 132 Governance & Security
- 8 Domo Community Gallery
- 44 Product Releases
- 12 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 111 Community Announcements
- 4.8K Archive