Sample Data:

```day       employee    expense_reason        expense
2/24/2018   abc   car mileage               \$5
2/24/2018   xyz   car mileage               \$5
2/24/2018   xyz   car rent                  \$8
2/24/2018   xyz   car rent                  \$9
```

Find all the occasions where single employees have claimed both the expenses on the same day.

I have created the following view in Tableau using day and employees as rows and expense and the reason as column and finally sum(number of rows) on the text of the markscard.

What I am getting is the grand total using analysis>>totals>>show row totals instead of getting row totals, Can anyone help me to get the count of non zero values in a row

```                  expense_reason
day        employee   car mileage   car rent    grand total
2/24/2018   abc         1                         1
2/24/2018   xyz         1           2             3
```

# update 1

I tried this but it is not giving output as I want

Apr 4, 2018 in Tableau 2,905 views

## 1 answer to this question.

In first part you should solve the No-Data part since there is no data for the combo abc-rent.

In order to it you can use the lookup function, and force a fake lookup using 0 as parameter.

LOOKUP(SUM([Something]),0)

Then you can use ZN function and force a zero for a null value, which is different from No Data.

That being said, you should be able to get something like this:

Create this calculated field:

```zn(LOOKUP(max({ FIXED [day],[employee],[reason] : COUNT([reason])}),0))
```

EDIT

If you want to have grand totals, i think this should be the better solution:

And the Calculated Field is a pure Count nested in a lookup function as said before:

`zn(LOOKUP(COUNT([expense]),0))`

• 10,240 points

## How to calculate the percent of records within a group in tableau?

You can click the measure SUM(Number of Records) and ...READ MORE

## How to fetch the previous value in a column or row?

Hi Sindhu, You can use LOOKUP() or PREVIOUS_VALUE() in ...READ MORE

## How to replace the count(field) which is missing in data with zero in tableau?

Use calculated field to create a dummy ...READ MORE

## How can I count the aggregate function in Tableau

Create two calculated fields one for 100's ...READ MORE

## How to use LOD to count distinct number of records based on some condition?

From the desired output it seems that ...READ MORE

## How to aggregate and count the occurrence of TRUE and FALSE?

Hi, you can do any of below ...READ MORE