6 Replies Latest reply: Nov 26, 2012 1:36 PM by Michael Solomovich

# dimension previous values

My dimension is =date(WeekStart(ISTEK_ACISTARIHI2),'DD.MM.YYYY')

As you understand it gets startofweek

in my data last startweek 19.11.2012 week

how can I get previous week start date 12.11.2012 and previous start week dates

=date(Max( date(WeekStart(ISTEK_ACISTARIHI2),'DD.MM.YYYY'))) it gets last week start date

• ###### Re: dimension previous values

Previous week start date is a start date of the week 7 days before the date:
date(WeekStart(ISTEK_ACISTARIHI2-7),'DD.MM.YYYY')

Or, 7 days before the start date, if you prefer so:

date(WeekStart(ISTEK_ACISTARIHI2)-7,'DD.MM.YYYY')

Regards,
Michael

• ###### Re: dimension previous values

Hello Michael ,

Thanks for reply the actual problem is that

=count((if(date(today(),'DD.MM.YYYY')-date(ISTEK_ACISTARIHI2,'DD.MM.YYYY')>=30 and ISTEK_DURUM='Açık',1))) in this expression when I calculated 30 days before today data

it is ok

but if I try to calculate for dimension you sent It gives 0

I want to  calculated 30 days before date just you sent

date(WeekStart(ISTEK_ACISTARIHI2-7),'DD.MM.YYYY')

• ###### Re: dimension previous values

In this case, if I got your requirements correctly tjhis time, don't change your dimension, but use this expression (you don't need to format the dates here):

count((if(date(today()-7)-date(ISTEK_ACISTARIHI2)>=30 and ISTEK_DURUM='Açık',1)))

• ###### Re: dimension previous values

I want to  calculated 30 days before date just you sent

date(WeekStart(ISTEK_ACISTARIHI2-7),'DD.MM.YYYY')

• ###### Re: dimension previous values

In qw file attached , İn turuncu hat istekler tab you can see my example

• ###### Re: dimension previous values

I doubt that you have it the way you actually need.
From your description, I understand that you want to see, for each week, a count of items between the start of this week, and 30 days back from that point.  For example, if weekstart is Dec 26, 2012, you want to count items between Nov 27 and Dec 26.  Instead, your expression returns the count for each week if the item is within this week and older than 30 days.  As a result, you get simply weekly counts for older weeks and 0 for the most recent weeks.
If my assumption is correct, you need a logical data island for weeks, and use it as dimension in the chart.  If you call this field WeekStart, your expression will be
count(if(ISTEK_ACISTARIHI2<=WeekStart and ISTEK_ACISTARIHI2>WeekStart-30 and ISTEK_DURUM='Açık', 1)))
And, the "previous" will be
count(if(ISTEK_ACISTARIHI2<=WeekStart-7 and ISTEK_ACISTARIHI2<Weekstart-37 and ISTEK_DURUM='Açık', 1)))

Regards,
Michael
PS: If I find time later, I'll create a sample app.