7 Replies Latest reply on Dec 7, 2017 1:12 PM by sudhir ranajn

# Number calculation

Hi Experts,

I want show count and share for different categories. Here the requirement is count and share should be chosen dynamically from drop down.

So to achieve this I have created a parameter for count and share drop down. But I am facing problem to get proper number format.

Ex: For count the number should be "number whole" and for share, it should be "percentage" with "%" symbol.

I have attached a dummy workbook for your reference. Please share some suggestion/workaround to resolve this issue.

Any help would be appreciated.

Thanks,

Sudhir

• ###### 1. Re: Number calculation

Sudhir,

Find my approach as reference below and stored in attached workbook version 10.3 located in the original thread.

1. M1. Quantity Count: COUNTD([Quantity])

2. M2. Quantity Share: (SUM([Quantity]) / TOTAL(SUM([Quantity])))*100

3. M3. Find ".": find(str([M2. Quantity Share]),'.')

4. M4. % of: mid(str([M2. Quantity Share]),1,[M3. Find "."]+2)

5. P1. Quantity Count/Share

5. M5. Count/Share

CASE [P1. Quantity Count/Share]

WHEN "quantity count" THEN str([M1. Quantity Count])

WHEN "quantity share" THEN str([M4. % of]+" %")

END

Regards,

Norbert

1 of 1 people found this helpful
• ###### 2. Re: Number calculation

Hi Norbert,

You have done a great workaround. Could you please share your workbook, so that it would be more helpful for me to identify your calculations.

Thanks!

Sudhir

• ###### 3. Re: Number calculation

Hi Sudhir,

Apologies. Find attached workbook in version 10.3

Regards,

Norbert

2 of 2 people found this helpful
• ###### 4. Re: Number calculation

Hi Norbert,

Simply you are genius. Your workaround helped me a lot.

You are Rock!

Sudhir

• ###### 5. Re: Number calculation

Hi Sudhir,

You are welcome. Glad I could help out.

Regards,

Norbert

• ###### 6. Re: Number calculation

Hi Norbert,

I am getting the expected value but again facing another issue. I have to calculate '% change in prior period' value. I cant calculate the value because all the metrics are strings now. The logic is [ (current period)/(prior period)-1 ]. It is throwing me error

"cant divide string value to string vale".

Regards,

Sudhir

• ###### 7. Re: Number calculation

Hey Norbert,

I have attached a screenshot of your workbook for better clarification. Scenario is like I have to calculate quantity 'count' and 'share' for 2017 and 2016 individual. Then to show '% change' between two periods.

Any help should be appreciated!

Regards,

Sudhir