Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Guys,
I need to get the value of week -1 compared with week of today()-1 / any idea ?
Here are the fileds of week of my calendar dimension:
if u like, i will give you my calendar dimension script
Thanks a lot
In which object?
For last week against a date field, try like:
Week(Date-7) as LastWeek
For static week value compared to today, try like = Week(today()-7)
here is my expression :
=num(sum(RVN_AIRTIME ) ,'# ##0')
I asked about which object are you trying to do this? Text box? Straight table? Bar chart?....
sorry, it s a text box
May be this
=Num(Sum({<[calendar date] = {"$(='>=' & Date(Today() - 8, 'D/M/YYYY') & '<=' & Date(Today() - 1, 'D/M/YYYY'))"}>}RVN_AIRTIME ) ,'# ##0')
So, if today is 10/23/2017, the above expression will show 10/15/2017 to 10/22/2017. Tomorrow when it will be 10/24/2017, the above expression will show 10/16/2017 to 10/23/2017. Is this what you want?
Thanks Sunny, That's it, but i want to use a week of date filed in my calendar dimension, but it didn't work :
=num(sum({<[Week of date] = {"$(=[Week of date]-1)"} >} RVN_AIRTIME),'# ##0')
is there any error in my expression ?
Thanks
This is a little tricky, because it depends on your week numbering system.
Getting the week value for all but the first/last weeks is easy - just subtract one.
If it's important to get this correct for the first/last week (which can be 52, 53, or 54 depending on system and may be a partial week depending on system), you'll have to use the same function for this as you did to get the week numbers in the first place. As long as you aren't using partial weeks, the approach suggested by Tresesco above - Date-7 - should work.
Why week of date? what is the issue with calendar date?