I have not quite understood the question, but try something.
File attached created by version 9.0.
Change to week bucket.
Then change the start day of week. ==> follow the link.
datedate.twbx 7.6 KB
Awesome, now I know what I was doing wrong - it was trying to enforce the week rule at the table calculation level as well.
So if I want to display just this week's percentage difference compared to last week's number, how do I do that? I tried filtering the date to show just this week, but because the filter doesn't show the previous week's # of records, it isn't able to calculate the percentage difference. Any idea how to show just this week's percentage difference?
Little bit tough in that case.
However, two ways I can propose.
Anyways, you need to create parameter added from [date].
Then calc field like below.
if datepart('week',[Parameter 1])=datepart('week',[Date])
or datepart('week',([Parameter 1]-7))=datepart('week',[Date])
then [Date] end
Put [Show date] instead of [date] then exclude null.
Your table calc still works in this case. (==> see one way tab)
Another way is also create three more calc field
[Parameter week count]
if datepart('week',[Parameter 1])=datepart('week',[Date]) then 1 else 0 END
[Parameter Previous week count]
if datepart('week',([Parameter 1]-7))=datepart('week',[Date]) then 1 else 0 END
[Current week count / Previous week count]
sum([Parameter week count])/sum([Parameter Previous week count])
Then you can show in one line. (==> Another way tab)
datedate rep.twbx 39.1 KB
For your second question you could do
IF LAST() == 0
THEN SUM([Value]) / LOOKUP(SUM([Value]), -1)
And set that to compute using your Date.
LAST() == 0 equates to the most recent Date in your Viz, because the most recent Date will be the LAST Partition.
So on the most recent date, Take the SUM of that Value and Divide it be the SUM of the Value from the previous partition (Previous Week). Since we don;t add an ELSE statement, all partitions that aren't the LAST one will equate to NULL, aka, no value will show.
Hey Rody, thanks for the suggestion. Is there a way to use that calculation as a filter? I originally followed this post (Re: Can I calculate a shape as an 'up' or 'down' arrow depending on a quick table calculation?), but I think I got it with your tip.
Basically, I put your calculation as the filter. But since this week's value calculates to 7, the filter is set to that number. Will this automatically update next week? How do I filter out everything except for NULL? Or will the current filter work in the future as well?
Nevermind, found the tab within filters to do it
Sorry for the late response.
Did you get your issue solved?
If so can you please mark a response a correct, or share your solution and mark that as correct.
This will help other members who are searching for answers for similar questions.