11 Replies Latest reply on Dec 28, 2018 8:50 AM by Yuriy Fal

# Numeric Distribution calculation

Hello there!

I'm very beginner in Tableau and not so familiar with Calculated Fields.

I need to add ND column in the table: ND = sellers / Universe * 100% for all rows in the vis and for total as well.

Thank you!

• ###### 1. Re: Numeric Distribution calculation

Hi Artem,

Analysis Menu --> Create a calculated Field --> A Pop UP wil open

1) Provide the name as ND

2) Write the below calc

SUM(Sellers) /SUM(Universe)

3) Click Apply

4) Click ok

5) You will find the created calculation in Measures pane

6) Right Click on ND --> Default Properties --> Number format --> Select Percentage

7) Drag the ND after Universe in measure values Section

you will get the final O/P as Required

Hope this helps.

BR,

NB

• ###### 2. Re: Numeric Distribution calculation

Hi Naveen! Thank you for your attention

There is nuance I've forgot to tell: columns are not a measure but part of a pivot table.

Literally i need to calculate: ND = Value of the Fact named "sellers" / Value of the Fact named "Universe" *  100%

• ###### 3. Re: Numeric Distribution calculation

Hi Artem,

Could you please attach a sample workbook.

BR,

NB

• ###### 4. Re: Numeric Distribution calculation

Hi Naveen!

I've managed to calculate ND by this formula:

SUM(IIF([Fact]="Brand sellers",[Fact Values],NULL)) / SUM(IIF([Fact]="Universe",[Fact Values],NULL))

But I still can't add it to the table as a separate column: Sample is in attachment

• ###### 5. Re: Numeric Distribution calculation

You need to create separate calculation for each fact and use measure names and measure values to plot the data.

1 of 1 people found this helpful
• ###### 6. Re: Numeric Distribution calculation

I'm sorry Naveen, but I don't get your point. Can you please share an example?

• ###### 7. Re: Numeric Distribution calculation

Hi Naveen,

I've made all facts as calculated fields and calculate ND easily: In table format it looks ok, because I can filter necessary facts to show: But on a second sheet where facts displayed on a map one-by-one, I need to exclude at least 2 fields from the filter, but I don't know how: Can you please suggest the workaround?

• ###### 8. Re: Numeric Distribution calculation

So, I've hide unnecessary facts and workaround looks fine until I faced with the issue: I'm not able to use Measure Names dimension as a single filter for multiple sheets on a dashboard.

Seems it ruins the idea of using calculated facts

• ###### 9. Re: Numeric Distribution calculation

Hi Artem,

The perceived complexity of this (seemingly trivial) task

is derived from the fact that the data are not in a proper 'shape'.

Namely, the [Fact] (as well as the related [Brand] ) has to be a Dimension (as it is),

but it should include additional Values -- to be used as the 'placeholder' Headers

for the additional Marks on a view populated with the 'derived' (calculated) Measures.

And there is a simple 'rule' in Tableau:

to have Marks on a view one should have Rows in the data.

This brings us to the concept of a so-called 'Scaffold' datasource --

a specially prepared one which is logically structured as a 'virtual cube'

consisting of all the necessary Dimensions with all the necessary Values

(aka domain-complete). The combinations of these Dimensions Values

form the 'Cells' of the cube -- which translates to the Marks on a view --

so they could be populated with the results of (aggregated) Measures,

potentially from other datasources as well (via a Data Blending mechanism).

Please find the attached as an example of such a Scaffold datasource (and a view).

Hope it could help understanding. Please reply with any question that may appear.

Yours,

Yuri

BTW, you can drop me a message or email, and we talk about things.

• ###### 10. Re: Numeric Distribution calculation

Hi Yuriy!

I'm very appreciated for your reply and suggestions, but I already managed to build my report without reshaping the source data.

Can you please share some links where I can learn the best practices?

Thanks once again! Wish you merry holidays and happy New Year!

• ###### 11. Re: Numeric Distribution calculation

Hi Artem,

As for the references, i would recommend this:
{"ft_lang_label":"__label__en","ft_lang_prob":0.88182414,"math_prob":0.73122704,"size":4559,"snap":"2020-10-2020-16","text_gpt3_token_len":1177,"char_repetition_ratio":0.14665203,"word_repetition_ratio":0.08838384,"special_character_ratio":0.2575126,"punctuation_ratio":0.117067836,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.95717496,"pos_list":[0,1,2,3,4,5,6,7,8,9,10],"im_url_duplicate_count":[null,3,null,3,null,3,null,3,null,3,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-02-22T10:26:05Z\",\"WARC-Record-ID\":\"<urn:uuid:d83cd3c3-2907-4ffa-b7b4-c0405fe3c9a1>\",\"Content-Length\":\"146808\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:94ac7ff8-d536-4889-b80c-e2f44b03a656>\",\"WARC-Concurrent-To\":\"<urn:uuid:00f23779-87c3-4946-bf05-6bac0072f361>\",\"WARC-IP-Address\":\"204.93.79.205\",\"WARC-Target-URI\":\"https://community.tableau.com/message/860226\",\"WARC-Payload-Digest\":\"sha1:PYMP7TFJ5B3V3K2RN6YLKSXYLIYZOAE6\",\"WARC-Block-Digest\":\"sha1:ZHFXOTSOUGZ5W6TGTURTQ2VUCXMLRVY5\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-10/CC-MAIN-2020-10_segments_1581875145657.46_warc_CC-MAIN-20200222085018-20200222115018-00043.warc.gz\"}"}