Skip to Content
avatar image
Former Member

WEBI - Using MAX in a measure

Hello,

I have two queries.

Query 1

ID

Max Date

(there is criteria, so that max date of when something happened which may not actually be the latest date)

Query 2

Unique ID

ID

Date

I am trying to create a variable to bring back the MAX Unique ID from query 2 where date in query 2 in the max date from query 1.

(because there could be more than one record on the date in query 2)

My variable keeps bringing back the MAX Unique ID bit not the max at when the dates are the same.

=Max([Query2].[UniqueID]) In ([Query2].[ID];[Query2].[Date]) Where ([Query2].[Date] = [Query1].[Max Date])

I know it has something to do with the context..I just haven't been able to figure out the order of the where, In, for each..etc.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Oct 25, 2017 at 01:38 PM

    try this.

    =If ([Query 1].[Max date]=[Date]) Then Max([Unique ID]) In ([ID])

    Add comment
    10|10000 characters needed characters exceeded