4 Replies Latest reply: May 24, 2011 8:42 AM by Claudia Zwick

# Compare the same field in one table

Hi everybody,

I have one table with the following informations:

%item, %week, stock

23, 13, 1234

24, 13, 145

24, 14, 458

25, 14, 1547

23, 15, 2458

25, 15, 147

Now I want to compare the weeks to find the difference to show it in a bar chart:

item, 13, 14, 15

23, +1234, +0, +1224

24, +145, +313, +0

25, +0, +1547, -1400

That are the start result for every week. I can also find out the end result for every week, if I need to. Maybe I need to, or?

But how compare I this week with the week before without selecting one week out? Without something like, week(today()) and week(today()) - 1.

• ###### Re: Compare the same field in one table

Hi,

look attached example, do you mean that?

• ###### Re: Compare the same field in one table

Not really. In that table are the real results, which you cannot sum at the end.

My table means:

I have from the product 23 at the start of week 13 1234 examples.

At the start of week 14 I have no visible moving from the start of week 13 to its end.

At the start of week 15 I have a purchase of 1224, although I have now 2458 examples.

And I want to show the difference between the start of week 13 an the start of week 14, ect.

You can say, that firstvalue of week 14 is the lastvalue of week 13.

• ###### Compare the same field in one table

Hi,

if you have a datefield, you can use the function WeekStart() and WeekEnd().

• ###### Compare the same field in one table

Yeah, but I have already the information. WeekStart ist the first day of the week 00:00. That are the information above.
But you can say, that the WeekStart 00:00 is the same value like the WeekEnd 23:59.

Now I want to see the difference between the weekstarts. Can I do that with the information above?

The table above is the result of a daily table.

I add some more rows for one item, so that you can better understand:

DailyTable

%item, %week, date, stock

23, 13, 28.03., 0

23, 13, 31.03., 1234 (Purchase 1234)

23, 14, 05.04., 934 (Sale 300)

23, 14, 07.04., 1234 (purchase 300)

So at the WeekStart 13 I have 0, at the WeekEnd 13 = Weekstart 14 1234 => in the week 13, I have + 1234