13 Replies Latest reply: Sep 14, 2017 8:29 AM by Anand Chouhan

# Set analysis - division

Hi,

If I have to calculate sum(x)/sum(y) for the latest month in a text box would I have to do it this way

sum({<[Month ] = {'\$(VMaxMonth)'}>}x) /sum({<[Month ] = {'\$(VMaxMonth)'}>}y)

• ###### Re: Set analysis - division

what is the Format of your month?

• ###### Re: Set analysis - division

Normally, This?

Sum({<Month = {'\$(=Max(Month))'}>} (x/y))

With Variable, This?

sum({<Month = {'\$(VMaxMonth)'}>} (x/y))

• ###### Re: Set analysis - division

you can also use FirstSortedValue function. A sample data would be helpful here

• ###### Re: Set analysis - division

How do we use this function in this case

consider the following data

1            100                       90

2             200                     100

I want to get the month 2 data in this format 100/200.

• ###### Re: Set analysis - division

try this

sum({<[Month ] = {"\$(=max(Month))"}>}x) /sum({<[Month ] = {"\$(=max(Month))"}>}y)

• ###### Re: Set analysis - division

Then try this if Month is NUM field

sum({<[Month ] = {"\$(=max(Month))"}>} ReceivedFIles) / sum({<[Month ] = {"\$(=max(Month))"} >} SentFiles)

• ###### Re: Set analysis - division

Are you doing this in a table where Month is a dimension? If this is true, then try this

Sum([Sent Files])/Above(Sum({<Month>}[Sent Files]))

• ###### Re: Set analysis - division

Regards

Anand

• ###### Re: Set analysis - division

Did you have num month field if not please introduce in data model

*,

Num(Month(DateField)) as NumMonth

From Source;

On the UI try this

sum({<NumMonth = { "\$(=Max(NumMonth)" }>}x)  / sum({<NumMonth = { "\$(=Max(NumMonth))" }>}y)

• ###### Re: Set analysis - division

Another way try this also for latest month

sum({<NumMonth = { "\$(=Num(Month(Today()))" }>}x)  / sum({<NumMonth = { "\$(=Num(Month(Today())))" }>}y)

• ###### Re: Set analysis - division

thank you all for help.

• ###### Re: Set analysis - division

In Month field what type of data you have kind check it seems NumMonth work here because Max(Month)) gives you numeric values kindly check this.