Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Does anyone know if it is possible to "shift" the startpoint of a dimension?
E.g. I have a graph with weekdays that displays yesterdays sales and a prediction for the next 6 days. I want my Y-axis to start at yesterday (thursday). So it should show: thursday-friday-saturday-sunday-monday and so on. Tomorrow it should show friday-saturday-sunday.
I have attached an example graph, values in red are predictions while blue is the last known value.
Any help will be appreciated.
Yes, my solution is date based.
I'm not sure what you are trying to achieve. Maybe you can work a little bit with my sample.
Best regards,
Tom
Sounds more like you just want to show eight days of a date field:
sum({<MyDate={'>=$(=today()-1)<=$(=today()+6)'}>} SomeMeasure )
No,
I want to show the count of one day's sales (yesterday's), and the other days are computed in the expression.
The issue is that I want the Y-axis to start at yesterday because that's visually more attractive to the end-user. (i.e., last known value, then predicted values).
FYI, the prediction is computed as follows:
Count({1<SALESTS_DATE={">=$(vMinusWeek)"}>}SALES_UNIQUEID)*vGrowthWeek
I think for your way to work I should compute the growthfactor in the script and create fake records? Anyway, all I want to do is to shift the axes, i.e to let it start on thursday and end on wednesday.
Hi,
i think it should work, if you do a calculated dimension:
=if(date >= (Today()-1) and date <= (Today()+6), WeekDay(date), Null())
and check 'Suppress When Value Is Null'.
To get the right sort, Sort by Expression 'date'
This works for me, when I tried this with inline data.
Best regards,
Tom
Hey Thomas, I don't actually have records with dates higher than today. So your solution won't work, I think?
Could you please provide me with your sample file so I can check?
Yes, my solution is date based.
I'm not sure what you are trying to achieve. Maybe you can work a little bit with my sample.
Best regards,
Tom
<Edit>
I have marked your answer as correct because I created the dimension based on LAST weeks days. Thanks!
</Edit>
Yeah I considered that option, but it's not very workable for me.
What I do is, I take last weeks count of sales and multiply that with a factor.
Eg. if the factor is 1.05 and last week friday sales count was 100 then I plot 105 for next friday in the graph.
For yesterday I take actual yesterdays values, ie. thursday sales was 101 so I plot 101.
Now I want the graph to start at yesterday (plot 101), then for friday it will plot 104. All I need to do is to shift the display order of weekdays.
Glad, I could help!
Have a nice weekend!
Best regards,
Tom
All I need to do is to shift the display order of weekdays.
I could be misunderstand you but if you always want to display yesterday's date first you could do something like this:
If yesterday = Thu then
Thu = 1
Fri = 2
etc.
if yesterday = Fri then
Fri = 1
Sat = 2
etc..
See the attached qvw for an example.
(I'm sure there must be a smarter way of doing this but it seems to work)