3 Replies Latest reply on Jan 26, 2017 12:30 PM by Ginger Macfarlan

# Identifying Unique Store-Item Combinations from Different Sheets

I have two sheets in a workbook. Each contains a complete Item Number-Store Number table: one a "Pre-Store Updates" table and one a "Post-Store Updates" table. I'm trying to come up with a way to compare the two sheets in Tableau that labels which items are new to a given store (i.e., a unique store-item combination appears ONLY on the "Post-Store Updates" sheet), which items are no longer in a given store (i.e., unique store-item combo appears ONLY on the "Pre-Store Updates" sheet), and then which items in a given store have remained the same (store-item combo appears in both). To add complexity, there are more store numbers on the "Post" list since more stores have been opened, so I need a way to account for that, as well.

This seems like a doable goal, but I'm at a loss for how to calculate it in Tableau. I'm working in Tableau 10.1.

• ###### 1. Re: Identifying Unique Store-Item Combinations from Different Sheets

Hi Ginger

An approach to try is to create 2 sets - 1 pre and 1 post

Then you can create a combined set and you have your choice of join types

Let me know if that helps

Jim

• ###### 2. Re: Identifying Unique Store-Item Combinations from Different Sheets

Ginger,

Here are the steps to solve for this:

1. Bring in both sheets from your Excel workbook, and form a UNION in Tableau.

2. The union will create an auto-generated column called "Table Name". This will identify which sheet each row came from.

3. Use an LOD Expression like the following to detect the disposition of each item. (Here I make assumptions about your column and sheet names.)

```IF { FIXED [Store Number], [Item Number] : MIN([Table Name]) } <> { FIXED [Store Number], [Item Number] : MAX([Table Name]) } THEN
'Remained the Same'
ELSEIF [Table Name] = 'Pre-Store Updates' THEN
'No Longer In Store'
ELSEIF [Table Name] = 'Post-Store Updates' THEN
'New to Store'
END
```

This is a row-level evaluation that can then be used as a dimension in your reporting.

1 of 1 people found this helpful
• ###### 3. Re: Identifying Unique Store-Item Combinations from Different Sheets

This was what I needed. Thanks!