9 Replies Latest reply on Oct 25, 2018 4:16 AM by Rafał Świeży

# Mode of most frequently order size

Dears, I have already read about the MODE and saw the solutions proposed, but I couldnt connet that solutions to my data. I am preparing analysis for our demand planning department, I want to show them in specific period of time information for each product about sales, number of different customers, average order qtty etc. And I also want to give them possibility to see the MODE of qtty of Order (this information can help us improve the carton packaing) - maybe our clients prefer differnt qtty mostly. But how to show the MODE of QTTY next to other things?

Sample data below and attached:

Tableau workbook screenshot below and attached:

• ###### 1. Re: Mode of most frequently order size

Hi Rafal,

Try this calculation and putting it onto the filters shelf and set it to true:

{ FIXED [Item] : MAX({ FIXED [Item], [Qtty] : COUNT([Qtty])})} =  { FIXED [Item], [Qtty] : COUNT([Qtty])}

Thanks,

Mavis

• ###### 2. Re: Mode of most frequently order size

Thank you, but this doesn' allow me to show it as separe column on my summary right? I need to have one separe sheet with this filter on and add this data later to another sheet?

• ###### 3. Re: Mode of most frequently order size

Hello Rafal,

1. create a calculated field , lets say Mode

IF { FIXED [Item]: max({ FIXED [Item], [Qtty] : COUNT([Qtty])}) } =

{ FIXED [Item], [Qtty] : COUNT([Qtty])} THEN

[Qtty]

END

2. Bring that field on marks card and set it to ATTR

Volla!!

1 of 1 people found this helpful
• ###### 4. Re: Mode of most frequently order size

When checking I saw that This calculation didnt calc the Mode, for set of order qtties below:

It returned 5 – while it should be 1 – can you help?

Pozdrawiam,

Rafał Świeży

Kom. +48 505 655 306

• ###### 5. Re: Mode of most frequently order size

When checking I saw that This calculation didnt calc the Mode, for set of order qtties below:

It returned 5 – while it should be 1 – can you help?

Pozdrawiam,

Rafał Świeży

Kom. +48 505 655 306

Pozdrawiam,

Rafał Świeży

Kom. +48 505 655 306

• ###### 6. Re: Mode of most frequently order size

Hi Rafal,

In that case, please use this calculation:

avg(if

{ FIXED [Item] : MAX({ FIXED [Item], [Qtty] : COUNT([Qtty])})} =  { FIXED [Item], [Qtty] : COUNT([Qtty])}

then ([Qtty])

END)

and add it into your view. There will be no need to add anything to the filters shelf because the filtering happens in this calculated field already.

Thanks,

Mavis

• ###### 7. Re: Mode of most frequently order size

I saw that my picture wasn't attached, I attach it again:

When checking I saw that This calculation didnt calc the Mode, for set of order qtties below:

It returned 5 – while it should be 1 – can you help?

• ###### 8. Re: Mode of most frequently order size

Can you please attach the data for the snapshot you attached?

• ###### 9. Re: Mode of most frequently order size

Dear, I have exported the data from the view for just few items and I connected to that data again and set up very simple view with only this "mode calc" and then Mode started to work fine! - do you have any idea why in bigger workbook with full set of data with more filters and elds in the view the formula doesn't work???