10 Replies Latest reply on Feb 28, 2017 1:55 PM by Yuriy Fal

# How to count new dimensions (part 2)

Hi,

This is a question I asked a few days back and it was partly answered, but I can't get all the way there.

A co-worker keeps having new activity codes (dimensions) imposed on him from upstream in the organization. He has no control over this. He just wants to be aware when new codes are added.

I've  created a simplified example with 13 codes, represented by the letter A through O.

On the first data dump of the period, he gets 7 codes: A, B, C, D, E, F, G. All are new codes.

On the second he gets 4 codes: C, D, F, H. Three he has seen before (C, D, F). One is new (H).

On the third, he gets 3 codes: B, F, H. All three he has seen in prior dumps. There are no new codes.

On the fourth, he gets 9 codes, of which 5 are new.

So the new codes for the four dates are 7, 1, 0 and 5. Here is what this looks like:

What I want is a view that just shows the number of new codes by date:

And as you can see from the attached workbook, I have managed (with some help from this forum) to show the new dimensions by date. But I cannot count them and show the totals despite lots of trying with various table calculations. What you see below (clipped from the attached workbook) is as far as I've gotten.

As you can see, only the new dimensions show up, with the exception of 2/14/2017, where I want to display a zero or some indication that there was a scan but there were no new categories.

Anyway I can display the count of new dimensions on a single line by date?

Any help would be greatly appreciated. Thank you.

Dan

• ###### 1. Re: How to count new dimensions (part 2)

Hi Dan

[Count New]

window_sum((if [Rank]=1 then 1 else 0  end))

Thanks,

Shin

1 of 1 people found this helpful
• ###### 2. Re: How to count new dimensions (part 2)

Hi guys,

Could be a little bit easier --

with LOD expressions.

Yours,

Yuri

3 of 3 people found this helpful
• ###### 3. Re: How to count new dimensions (part 2)

LOD vs Table calculation

I was too much rely on LOD, and as reaction recently, tends to use Table calculations heavier ??

Anyways, need to think the best way or both way each time.

Thank you for the follow up always, Yuri.

Thanks,

Shin

1 of 1 people found this helpful
• ###### 4. Re: How to count new dimensions (part 2)

Shin, you're always welcome.

PS 百花斉放百家争鳴

• ###### 5. Re: How to count new dimensions (part 2)

Any special meaning of this P.S> word?

This is a kind of political word in China....

百花斉放百家争鳴

• ###### 6. Re: How to count new dimensions (part 2)

Nothing special, meant just the opposite :-)

Simply grabbed the sentence out of context

and took the first part as a literal, so it goes as

"Let a hundred flowers bloom" -- and I like how it smells.

• ###### 7. Re: How to count new dimensions (part 2)

村上さん,

助けてくれてありがとう。日本の誰かから聞くのは良いことです。私は3年間日本に住んでいて、北海道の稚内から南の西表島へ旅しました。 （いいえ、私はワイルドキャットは見ませんでした。）

You solved my problem. However, I was not able to duplicate what you did in with your index calculated field. What you ended up with was this:

Here is  mine:

I'm  going to work on my version for a bit longer to try to duplicate what you've done. I am not clear on why your Index()2 field has nine values while mine has only one. This requires a bit more investigation.

Your screenshot were very clear and I appreciate the time you put into it. Thank you, Shin.

Dan

• ###### 8. Re: How to count new dimensions (part 2)

Hi Yuriy,

Apparently the forum software does not allow me to mark both answers as correct. This is a problem, since your answer was every bit as correct as Shin's. Just a different way of getting to the same answer. And in fact, I found it a bit easier to see how your LOD worked. I may just end up using your solution

Now it's a matter of applying it to the real dataset rather than the phony data I posted on the site. Of course the real dataset is way more complicated.

I continue to marvel both at how well people on the forum understand the obscure corners of Tableau and how quick they are to be answer the questions of strangers.

Thank you, Yuriy.

Dan

• ###### 9. Re: How to count new dimensions (part 2)

ダン、

日本で暮らしていたんですね。私は、知床には行ったことがありますが、稚内は行ったことがないです。いつか利尻山には登ってみたいです。

西表には、3～4回行ったことがあります。でも、20年以上も前です。星砂の浜と、ヒナイサーラの滝が好きです。

これからもよろしくお願いします。

Thanks,

Shin

• ###### 10. Re: How to count new dimensions (part 2)

Dan, you're welcome.