简体   繁体   中英

Count New Users Group in Tableau

These are the fields that I have Dimension: Usertype , when you filter I have "New Visitor" "Returning Visitor" Measure: users - sum of both new & returning visitors

How can I create the calculation that will count only New Visitors inside the users measure pill without using the filter option?

For those wondering answer is: usertype - dimension (New Visitor, Returning Visitor) users - measure (Total of both New Visitor and Returning Visitor)

MIN({FIXED [usertype]='New Visitor': SUM([users])})

An alternate, possibly more efficient, approach is to define a calculated field that incorporates your filter. Say define a calculated field called, New Users , as

IF [Usertype] = “New Visitor” THEN [Users] END

(This field will evaluate to null if the [Usertype] <> “New Visitor”)

If you then place SUM([New Users]) on some shelf, you'll have your result - without the complexity of an LOD calculation. LOD calcs are incredibly useful, but they add complexity and performance cost, so I'd recommend using them only when needed. In many cases, such as this, simpler methods work fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM