1 of 1 people found this helpful
So firstly, you shouldn't need to create a new post for this. It makes sense to continue on in your existing discussion, especially given that others have already started contributing to it. It helps newcomers to the thread understand what you've already tried, and we don't end up with several threads for essentially what will be the same root cause.
With regards to your problem, it's going to be really tough for us to provide insight here without seeing a Tableau Packaged Workbook including sample data. I'm sure you're hesitant to do that, so I'd suggest you mock up some sample data in excel and re-create the problem with sample data so we can take a look at that.
You're right, I'm attaching a small sample from my data - the tables has the main Dimension and attributes that I use in the views...
There are three sheets in the workbook:
- One called "Master Report" - in which the calculation works.
- The second called "Case" , It has the cross-tab for only "Case" calculation ---> "Total" shows zero
- The third called "If", it has the cross-tab for the "If" calculation as showen up ---> "Total" isn't calculated correctly, it shows the "Total"* # of rows in the "Source" dimension"
Hopefully this would help, Thank you!
Total_Sample.twbx 53.8 KB
On your if sheet, you could change the ClicksIf formula to;
IF ATTR([Source])=ATTR([Source]) THEN
WHEN "A" THEN ZN(SUM([WithoutCampaign (Sample)].[A Clicks]))
WHEN "B" THEN ZN(SUM([WithoutCampaign (Sample)].[B Clicks]))
WHEN "C" THEN ZN(SUM([WithoutCampaign (Sample)].[C Clicks]))
ELSE (ZN(SUM([WithoutCampaign (Sample)].[A Clicks]))
+ZN(SUM([WithoutCampaign (Sample)].[B Clicks]))
+ZN(SUM([WithoutCampaign (Sample)].[C Clicks])))
Because you're joining, two sources, you are effectively duplicating the metrics and thus you need to divide by something. This will give you the correct totals, but your grand total is going to be off.
Here's a rather long thread, but one which you should read - Re: Grand Total doesn't work!