Tableau LOD to find out first date for each field value

679 views Asked by At

I have a table for challenge_submissions -

date                       submitter          challenge
8/10/2020 9:02:16 AM         tim              Challenge1
8/10/2020 11:22:04 AM        morty            Challenge2
8/10/2020 11:45:10 AM        morty            Challenge1
8/10/2020 10:18:56 AM        tim              Challenge2
8/10/2020 9:34:14 AM         jim              Challenge3
8/10/2020 12:02:10 PM        pam              Challenge3

And another table that matches the players to their teams -

team            player
Team A           tim
Team A           pam
Team B           jim
Team B           morty 

I want a table that shows me which team solved how many challenges first, i.e. something like this -

Team            Score    First Solves
Team A           xxx          2
Team B           xxx          1

I tried making an LOD for it -

First Solve - {FIXED [challenge]: MIN([date])} and then another calculated field Is First solve - IF [date] = [First Solve] THEN [First Solve] ELSE NULL END

and then putting team and submitter in a hierarchy, but that doesn't work for me.

1

There are 1 answers

2
AnilGoyal On

You reached nearly.

Create an intermediate calc field for easy understanding

Whether first solved as

If [First Solve date]=[Date] then 1 else 0 END

Just to mention I have named first calculated field as first solve date

Create your desired field First solves as

{
FIXED [Team] : SUM([whether first solved])
}

You will get your view

Result

Do tell me if it works. Upvotes will be appreciated :)