Best Of
Re: Beast Mode to compare the record from the recent Monday to the last Monday
Thank you so much @mhouston !..really appreciate your help!
Re: Beast Mode to compare the record from the recent Monday to the last Monday
You can utilize a formula to calculate the most recent Monday for the week:
`Date` - INTERVAL (CASE WHEN DAYOFWEEK(`Date`) = 1 THEN 6 ELSE (DAYOFWEEK(`Date`) - 2) END) DAY
A week prior:
`Date` - INTERVAL (CASE WHEN DAYOFWEEK(`Date`) = 1 THEN 6 ELSE (DAYOFWEEK(`Date`) - 2) END) DAY - INTERVAL 7 DAY
DAYOFWEEK returns a number between 1 (Sunday) and 7 (Saturday).
The CASE statement is checking if it's a Sunday to subtract 6 days instead of 1.
-2 is to reduce the days to subtract to get to Monday. For example Tuesday (3) we need to subtract only 1 day instead of 3 days.
You can then filter your data where the date and the Monday date match. Twice - once for this week, once for last week.
To populate the New vs Old use a Formula tile as @mhouston recommended:
CASE WHEN `Left PO Column` IS NULL THEN 'New' ELSE 'Old' END
Re: How do I get the date to show up even when there are no results?
Start with the calendar dataset from the Domo date dimension connector and left join your dataset to it on the date using a dataset view or ETL. Then use the calendars date field instead of your own. Left join will cause your missing data to be null but still have the dates from the calendar
Re: Card Data
@Fadem your data is there it just can't show it all. Try doing an aggregation or providing filters for people when using the card and you will see all the data. You can also change what card type you are using. Are you using a Mega or Pivot table? I recommend using those and not the HTML table.
Ashleigh
Re: Card Data
How large is your dataset? I believe this error is typically seen when your dataset is larger than the rendering limits on the card - all your data is there but your visual gets truncated. (see kb article for limits: https://domohelp.domo.com/hc/en-us/articles/360042924214-Card-Building-FAQs)
mhouston
Re: calculate percentage difference between 2 values which is in a column
I think it's not working in your pivot table as laid out because you have the difference column underneath your larger categories of ACTUAL and BUDGET (so in the ACTUAL - difference, the only data the beast mode has is actuals).
The way we've implemented this is using an HTML table and just creating a beast mode for actuals, a beast mode for budget, and a beast mode for variance.
ACTUALS:
sum(
case when `version` = 'Actuals' then `account_value`
ELSE 0
end)
BUDGET:
sum(
case when `version` = 'Budget' then `account_value`
ELSE 0
end)
Variance:
(sum(
case when `version` = 'Actuals' then `account_value` else 0
end)
-
sum(
case when `version` = 'Budget' then `account_value` else 0
end))/
sum(
case when `version` = 'Budget' then `account_value` else 0
end)
Note that the variance calc here is actually a ratio, and then we use the domo formatting to format it to a percent.
mhouston
Re: Beast Mode to compare the record from the recent Monday to the last Monday
I would do this in an ETL by filtering your dataset to this monday, and then using a second branch, filtering to last monday. Then you can right join last monday to this monday on date, po number, and schedule code. You can use a formula tile and set it to "new" when the left side po number is empty, and "old" when the left side po number is populated.
mhouston
Re: Domo instance API - Method Not Allowed
export const get_authToken_domo = async (EMAIL, PASSWORD, DOMO_INSTANCE) => {
const auth_url = `https://${DOMO_INSTANCE}.domo.com/api/content/v2/authentication`;
const body = {
method: 'password',
emailAddress: EMAIL,
password: PASSWORD,
};
let resp = await fetch(auth_url, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(body),
});
const data = await resp.json();
return data.sessionToken;
};
just tested. this works.
Re: Domo instance API - Method Not Allowed
@Fatias true, i believe you would have to have the direct sign on exception enabled to use this method.

