Best Of
Re: beast mode calculation
You could create a beastmode that would count the number of tickets per customer site:
SUM(COUNT(DISTINCT `TicketNbr`) FIXED (BY `Site_Name`))
Then, you should be able to use this as a filter for your card.
Re: Min(Date) Question
You're correct that it's doing it on a per-row basis. If you want the minimum across your entire dataset, you can use a window function:
MIN(MIN(`Report_Date`)) OVER ()
Re: Calculate correlation coefficient in beastmode? Do not want to use correlation chart.
You're right. I played around and got CORR(`X`, Y) FIXED(BY Date) (with and average aggregation) to work, with some big caveats:
- If the standard deviation of either X or Y for a given date is 0, then you'll get a null value. So if you have flat values or vertical values on a given date, or only one value at a given date, you'll get a null result at that date, and then if you average that correlation into a week, you'll get a null for the whole week.
- You could overcome part of that by adjusting your function to CORR(`X`,
Y) FIXED(BY week(Date) ), but then your function won't adjust to the "Graph by" [week, month…] option - But let's say you have variance on every day of your dataset and you don't add 'week' to your function, so you can still use the 'Graph by'. You should be aware that averaging the results of the correlation is averaging each day's correlation. If you have a day with more data than another, this might not be the true correlation for the week. For example, if you have two values on Monday with a correlation of 0 and 18 values on Friday with a correlation of 1, you'll get an average of 0.5, when the true correlation is 0.9. (Unless you want each day to be weighted exactly equally).
Here's an example, showing how the CORR(`X`, Y) FIXED(BY Date) produces a null value for a week with a single day with no variance, and a slightly different result than the manual equation for a week with a single day with more value pairs than another day:
Re: I want to fetch count of data for a specific time frame (mon-fri)-(9-17)
@dheeraj_sandhanshi You can set up a beast mode like this to segment what data to filter:
case
when DAYNAME(`DateField`) in ('Saturday','Sunday') then 'Exclude'
when HOUR(`DateField`) >= 9 and HOUR(`DateField`) < 17 then 'Include'
else 'Exclude'
end






