Back

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

What I have? I am having a simple COUNTIF task in Excel

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

I am facing issues in replicating the same COUNTIF task in tableau. The column 'DynamicCalc' should have the following values when Metric=A1 is selected: TRUE,TRUE,FALSE,FALSE,FALSE but in case 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 (108k points)

I'll give you a concise idea on how to create LOD Expression:

Select Analysis > Create Calculated Field.

In the Calculation editor that opens, do the following procedures:

Name the calculation, Sales Per Customer.

Enter the following LOD expression:

{ INCLUDE [Customer Name] : SUM([Sales]) }

When finished, click OK.

The recently created LOD expression is added to the Data pane, under Measures. 

Learn Tableau with the help of this Tableau Certification Course.

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Dec 1, 2019 in BI by Vaibhav Ameta (17.6k points)
0 votes
1 answer
asked Oct 9, 2020 in BI by dev_sk2311 (45k points)
0 votes
1 answer
asked Jan 16, 2020 in BI by anmolj (9k points)

Browse Categories

...