'Lookup' in Beast Mode

utkarsh
utkarsh Member
edited November 2022 in Beast Mode

Hi,

I am looking for help to build a beast mode calculation for ColumnA here.

ColumnA does not exist in the data and will be built using Beast Mode. The first three values have to be manually input and the fourth value onwards I need it as a calc as shown. Can someone please help me with this? Please let me know if you have any questions. Thanks in advance.

Tagged:

Answers

  • Hi @utkarsh I don't believe there is a way to accomplish this in Beast Mode since the calculation for ColumnA is dependent on previous values of the same column. Ordinarily if you needed to reference values in previous rows, I would recommend the LAG function in the Rank & Window ETL tile (https://domohelp.domo.com/hc/en-us/articles/360044876094-Magic-ETL-Tiles-Aggregate#3.), but those window functions rely on fields that already exist in the data.

    I'm curious about how you arrived at the first three values of ColumnA. Is there a logic there that you could potentially replicate in this dataset?

  • Hi @MichelleH thanks for your response. The logic is tough to explain here, but for now if we just assume the first three values exist in the data using the following calc, can we build the next part of logic where we can reference the values from the same column?

    CASE when

    `Date` = '1/1/2022' then '208' when

    `Date` = '2/1/2022' then '197' when

    `Date` = '3/1/2022' then '192' else

    'Null' end

  • Hi @utkarsh no, I don't believe that's possible though others can correct me if there is a method I'm not aware of. While the logic of how you arrived at those original values is tricky, recreating that is likely your best option for creating ColumnA in Domo.

  • @utkarsh please articulate in business language what you are trying to accomplish. @MichelleH is correct, you can probably accomplish what you need using Window functions (the LAG() function) in particular, but to assess whether it would always be appropriate to use LAG it's important to understand your use case.

    Jae Wilson
    Check out my 🎥 Domo Training YouTube Channel 👨‍💻

    **Say "Thanks" by clicking the ❤️ in the post that helped you.
    **Please mark the post that solves your problem by clicking on "Accept as Solution"