Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

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

1 Solution

Accepted Solutions
marcus_sommer

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

View solution in original post

2 Replies
marcus_sommer

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

Anonymous
Not applicable
Author

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