Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in BI by (17.6k points)

I have a simple COUNTIF task in Excel that is proving rather difficult to replicate in Tableau...

This is the data:

ID   Metric   Scope   DynamicCalc

1    A1       TRUE    X

1    B1       FALSE   X

2    B1       TRUE    X

2    A1       FALSE   X

2    C1       FALSE   X

The column 'DynamicCalc' should have the following values when Metric=A1 is selected: TRUE,TRUE,FALSE,FALSE,FALSE but if say B1 is selected it would be FALSE,FALSE,TRUE,TRUE,TRUE... so basically I want to assign a value of TRUE to the DynamicColumn if there is at least one TRUE in the Scope column to all rows for that ID. 

1 Answer

0 votes
by (22.5k points)
edited by

Use the LOD Expression

{FIXED [ID],[Metric]:MAX(if [Scope]='TRUE' then 'True' else 'False' end)}

Check the tableau course for more insights

Related questions

0 votes
1 answer
asked Aug 1, 2019 in BI by ashely (50.2k points)
0 votes
4 answers
0 votes
1 answer

Browse Categories

...