Best Of
Re: How to remove duplicates without affecting the blank cells?
@Vishz14 I would suggest creating two separate branches of your MagicETL: one filtered to rows where Transaction ID is null, and the other where Transaction ID is not null. You can use Remove Duplicates tile on the branch that contains Transaction ID, then merge it back with the rows without a Transaction ID using an Append Rows tile.
Re: Beastmode not recognising exisisting column
@NateBI I'm glad it worked! Would you please accept my answer as a solution to help others find the solution more quickly?
Re: Beastmode not recognising exisisting column
@NateBI Does it still return an error if you put single quotes around TRUE? It may be reading that as a field name instead of a value.
DP22 - Using Beast Mode to Build Data Storytelling - Formatted Time Duration
This post is part of a series of beast modes I presented on during my “Using Beast Mode to Build Data Storytelling” Domopalooza 2022 session. If you find this post helpful please make sure to give it a like or an awesome below.
Use Case
We wanted a way to display how long an invoice took to process in a more human readable format. Instead of displaying the duration in seconds or hours and having the user do the “mental math” to convert it themselves this beast mode does that for the user to allow them to focus more on the story the data was telling.
Beast Mode
CONCAT( CASE WHEN `Ship Time` <= `Order Time` THEN '-' ELSE '' END, -- Days FLOOR ( ABS ( UNIX_TIMESTAMP(`Ship Time`) - UNIX_TIMESTAMP(`Order Time`) ) / 86400 ), 'd ', -- Hours, Minutes and Seconds SEC_TO_TIME ( ABS ( MOD ( UNIX_TIMESTAMP(`Ship Time`) - UNIX_TIMESTAMP(`Order Time`), 86400 ) ) ) )
Beast Mode Breakdown
CASE WHEN `Ship Time` <= `Order Time` THEN '-' ELSE '' END
If the ship time is before the order time precede the result with a negative. This allows us to simplify the logic calculating the difference and to have the negative displayed at the beginning of the number days instead of in the middle at the beginning of the hours.
UNIX_TIMESTAMP(`Ship Time`) - UNIX_TIMESTAMP(`Order Time`)
UNIX_TIMESTAMP returns the number of seconds (epoch) since January 1st 1970
Subtracting two UNIX_TIMESTAMP values calculates the difference between two timestamps in seconds
ABS ( UNIX_TIMESTAMP(`Ship Time`) - UNIX_TIMESTAMP(`Order Time`) ) / 86400
ABS will return the absolute value of the difference between the two times. This will force a negative difference to be positive. Again this allows us to simplify the logic and display the negative symbol one time instead of before the days and before the hours:minutes:seconds.
Dividing the number of seconds by 86400 (number of seconds in a day / 24*60*60) gets the number of days
FLOOR ( ABS ( UNIX_TIMESTAMP(`Ship Time`) - UNIX_TIMESTAMP(`Order Time`) ) / 86400 )
FLOOR drops anything after the decimal point returning whole days in the duration. We’ll be converting the partial days in the next step to hours, minutes and seconds.
SEC_TO_TIME ( ABS ( MOD ( UNIX_TIMESTAMP(`Ship Time`) - UNIX_TIMESTAMP(`Order Time`), 86400 ) ) )
MOD function will divide the duration in seconds by the number of seconds in a day (86400) and return the remainder. This will be the value of the partial day in seconds.
SEC_TO_TIME will take the remaining seconds and format it as HH:MM:SS
CONCAT(…)
CONCAT will add the different string values together to form a single value
Final Result:
Re: Success Rate %
@louiswatson It sounds like you're almost there already. How about this:
(count(case when `Status` in ('Application Consented','Application Refused','Waiting for Decision') then `Status` end)
+ count(`Appeal Determination Date`))
/ count(case when `Status` in ('Application Consented','Appeal Allowed'))
Re: Adjusting Axis values vs values on line chart
@NathanDorsch You would need to enable a second axis under Chart Properties > Value Scale (Right) > Show Right Scale. Then you will be able to set a different value format for anything on the right scale.
Re: Adjusting Axis values vs values on line chart
@NathanDorsch Try going to Value Scale under Chart Properties and changing Decimal Places to none.
Re: Is there a way to create a filter for line charts
@NathanDorsch So you would create a number of variables equal to the maximum number of lines you would want displayed (we'll use 3 for the examples you gave). You could name them Line 1, Line 2, and Line 3. Each one would have CPC, ROAS, and CTR as values. Then you would create 3 beast modes like the following:
case when 'Line 1' = 'CPC' then [CPC calculation]
when 'Line 1' = 'ROAS' then [ROAS calculation]
when 'Line 1' = 'CTR' then [CTR calculation]
end
Then use additional beast modes for more lines. You could also add a 'Blank' value for each variable and then in the beastmodes when the value = 'Blank' then you could set it to 0 so the line can be out of the way.
Re: Converting Text column with fiscal periods to a date
Hi @jkellams ,
I made you a video on how to do this: https://www.loom.com/share/5ce03a817b5a49c8b3b76b5f29bccb36
So you need to do some text formatting, but you can get the result.
John Le
You're only one dashboard away.
More video solutions at: https://www.dashboarddudes.com/pantry




