0

I am using Tableau to create a custom google analytics dashboard. I have a custom dimension named author in my google analytics view and I would like to group the date of the first page/view by author and by month having a counter. I successfully get the date of first page/view using MIN([Date]), but I don't figure out how to use LOD expressions to double aggregate a calculation. I tried the following expression, but tableau shows an error saying that the argument I'm trying to count is already an aggregation and can no longer be aggregated.

{INCLUDE [Author] : COUNT(MIN([Date]))}

What did I miss ?

belgacea
  • 1,084
  • 1
  • 15
  • 33
  • COUNT({INCLUDE [Author] : MIN([Date])}) try putting the count outside the LOD. – Bernardo Apr 09 '18 at 15:33
  • Thank you, but this function only returns 1 each time any page has been visited for an author and a month. That's not what I'm looking for. I have the date of first page view (AKA creation date) and I would like to count the number of unique pages viewed for an author and a month (if a page has already been seen for a given month, it will no longer be counted). – belgacea Apr 10 '18 at 10:15
  • Can you share some sample data or workbook? – Bernardo Apr 10 '18 at 15:37

1 Answers1

2

If your are trying to find the minimum of your [Date] field by your [Author] field, you might want to construct a LOD calculation to find first date, by author like so:

//Creates calculated field for [First Date by author]    
{FIXED [Author] : MIN([Date])}

You also have asked about 'double aggregating'. Let's say for example that you wanted find the minimum date, by author, but also by a [Topic]. In this case, you could write:

//Creates calculated field for [First Date by author, by Topic]      
{FIXED [Author],[PostTopic] : MIN([Date])} 

It is also possible to nest FIXED statements within one another. Let's say for example that you wanted to show maximum [PageViews] for a single month by [Author] and also wanted to limit the time span under consideration to to the first 3 months that an author was publishing. In this case, you could write:

//Creates calculated field for [Most page views in a single month within first 3 months, by Author]
//Example assumes [Date] is a monthly (not daily) data
{ FIXED [Author], [Date] <= DATEADD('month', 3, [First Date by author] ) : MAX({FIXED [Author],[Date]:SUM([PageViews])})}
SEAnalyst
  • 1,077
  • 8
  • 15