2 Replies Latest reply: Jan 31, 2015 6:00 AM by Elena Prandoni

# Calculating Values from a "Preset Week" to the "Max Week"

Hi all,

i need some help....

I would like to calculate ,e.g. by selecting the "WEEK" field  from 1 to last one :

1) The result of MARGIN% from Week 1 to Max(WEEK)

2) The result of MARGIN% from Week 1 to Max(WEEK)-1)

3) The Difference between these 2 values.

In other words:

If i select the first  5 weeks of the year 2015 , i would like to obtain something like that:

-----------------------------------------------------------------------------------------------------------

if

MARGIN% (between Week 1 and week 5)

<

MARGIN% (between Week 1 and week 4), 'ALERT','OK')

-----------------------------------------------------------------------------------------------------------

i can't figure out....

Thanks

Mark

• ###### Re: Calculating Values from a "Preset Week" to the "Max Week"

Try something like this:

if(avg({< Week = {"<=\$(=max(Week))"}>} MARGIN%) <

avg({< Week = {"<=\$(=max(Week)-1)"}>} MARGIN%), 'ALERT','OK')

with a selection on year=2015.

- Marcus

• ###### Re: Calculating Values from a "Preset Week" to the "Max Week"

Hi,

try to see if the attached qvw can help you: your logic is in the pink text box (I used two variables).

Let me know!

BR

Elena