Are you familiar with the tableau pivoting feature? Your data is structured in an unusual way. I would approach this by pivoting the data so you have essentially 3 colums - Store, Store Category, and Count.
+1 for pivoting. But this calc should work if you can't. Note: ZN return zero if null.
IF[store1]="Apple" THEN ZN([Store1 Count]) END +
IF[Store2]="Apple" THEN ZN([Store2 Count]) END +
IF[Store3]="Apple" THEN ZN([Store3 Count]) END +
IF[Store4]="Apple" THEN ZN([Store4 Count]) END +
IF[Store5]="Apple" THEN ZN([Store5 Count]) END)
Your data is really badly structured -
i used prep to restructure your data
once in this form the results are a very easy to construct viz
tableau has really good on-line training at Tableau Training: View Training Courses
see the sections on data prep and connections
If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution. Thank you.
test (12).twbx 18.9 KB
Thank for the advice!
I hadn't used Tableau Prep before, but it turned out to be very useful and the best solution for this messy data set.
Thanks Linda -
Prep was designed to clean up messy data - its a good tool - but if there is a chance to restructure the data at the source it is always a better solution
Glad to help out