-
1. Re: Using LOD Include, but find the subcategory name
Joshua Milligan Aug 22, 2016 2:19 PM (in response to Mick Leahy)Mick,
Try another calculated field that uses your existing one, something like:
IF
{INCLUDE [Sub-Category] : SUM(Sales)} == {EXCLUDE [Sub-Category] : MAX([Sales of Sub Category])}
THEN [Sub-Category]
END
That will allow you to compare the sum of Sales at a Sub-Category level with the Sales for the Max Sub Category and give you the sub-category where the two values are equal.
Hope that helps!
Joshua
-
2. Re: Using LOD Include, but find the subcategory name
Mick Leahy Aug 22, 2016 2:37 PM (in response to Joshua Milligan)Thanks Joshua for the reply. Have tricked around with that and doesn't generated me the answer
best I can do is when the sub category is the full amount of the category then I can generate the sub category name otherwise I get an *
-
3. Re: Using LOD Include, but find the subcategory name
Joshua Milligan Aug 22, 2016 2:45 PM (in response to Mick Leahy)Hmmm... works for me, but there may be something I'm not seeing that changes things in your case. Do you happen to have a sample workbook or even a screenshot of your setup?
-Joshua
-
4. Re: Using LOD Include, but find the subcategory name
Jonathan DrummeyAug 22, 2016 4:47 PM (in response to Joshua Milligan)
Two comments:
1) If you want to read a long post on the subject check out LOD Expression Remix – Finding a Dimension at a Lower Level | Drawing with Numbers.
2) Since LOD expressions are doing separate aggregations than the vizLOD when floating point numbers are involved you can end up with different results, you should either round them or convert to integers prior to doing the comparison. There's a comment on this just before the Conclusion of Bora Beran's fantastic post introducing LODs: What’s new in Tableau 9.0? Part 2 – Level of Detail Expressions « Bora Beran .
Jonathan
-
5. Re: Using LOD Include, but find the subcategory name
Mick Leahy Aug 24, 2016 6:16 AM (in response to Jonathan Drummey)cheers Jonathan, i used the first link which included a link to another post and this is effectively the code I used:
ATTR(
{INCLUDE [Sub-Category]:IF SUM([Customer Name])==MAX(
{EXCLUDE [Sub-Category]:MAX(
{INCLUDE [Sub-Category]:SUM([Customer Name])}
)})
THEN MIN([Sub-Category]) END}
)
-
6. Re: Using LOD Include, but find the subcategory name
Jonathan DrummeyAug 24, 2016 6:29 AM (in response to Mick Leahy)
Awesome!