Jump to content

Moving average result is different in bar graph and cross table (spotfire)


min cho

Recommended Posts

Hi,

i want to got a 3month moving average of raw data table .

However the result is different between in Bar graph and cross table as 2nd table.(Moving average result)

i want to visualize the reuslt of bar graph incross table.

raw data

 

 

 

 

L1

L2

R2

L3+L4

 

 

Jan

1601

598

1

73

 

 

Feb

1244

369

2

52

 

 

Mar

1480

497

0

54

 

 

 

Moving average reuslt

 

 

 

 

L1

L2

R2

L3+L4

 

 

Bar graph

72.43%

24.52%

0.05%

3.00%

 

 

cross table

72.64%

24.31%

0.05%

3.00%

 

 

 

i found some logic is different.

in bar graph, The logic is as below. (it shows the average of L1 quantilty (3month)/L1+L2+R2+L3+L4 quantity(3month) )

Sum([L1])

THEN Avg([Value]) OVER (LastPeriods(3,[Axis.X]))

THEN If(Count() OVER (LastPeriods(3,[Axis.X]))=3,[Value],null) as [L1]

in cross table, the loigc is as below. (it shows the average of the rate of L1 each month (3month) )

Avg([L1])

THEN Avg([Value]) OVER (LastPeriods(3,[Axis.Rows]))

THEN If(Count() OVER (LastPeriods(3,[Axis.Rows]))=3,[Value],null) as [L1]

However, if i change AVG to SUM, The result is chagned as below.

i think this is average for each quantity.

 

 

 

A

B

C

D

 

 

144167%

48800%

100%

5967%

 

 

 

Is there any way to get same result with bar graph in cross table

Thank you.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...