Wednesday, December 12, 2012

Highlight the Trend, Part Deux

Well I guess it all started the first time I went through the second grade. I caught my reflection in a spoon while I was eating my cereal, and I remember thinking "wow, you're not like every other kid, you know, who dreams about being an astronaut, I was always more interested in what bark was made out of on a tree. Richard Gere's a real hero of mine. Sting. Sting would be another person who's a hero. The music he's created over the years, I don't really listen to it, but the fact that he's making it, I respect that. I care desperately about what I do. Do I know what product I'm selling? No. Do I know what I'm doing today? No. But I'm here, and I'm gonna give it my best shot."



Which brings me to:

     if([City] = '$(=GetFieldSelections([City]))', Green(), ARGB(150,225,225,225))

Definitely not my best shot.

If you'll remember the end of my last post, that expression attribute limited you to highlight only one line at a time. Kind of useful, absolutely clever, but just not the right way to do it. And I sort of stole the idea from the QV Design blog. The most embarrassing part is that I made it worse. Now I'm going to make it better by making it a little simpler.

If you've forgotten how to do it, re-read the last post. The short review is to change your expression attribute to:

     =if(match([City],concat(distinct [City],',')),
         Green(),
         ARGB(150,225,225,225))

Now, any City or combinations of Cities will be highlighted green.

BONUS!

If you have a lot of lines, the old way may keep them hidden even though they are highlighted. Let's use part of our new expression attribute to sort (bring to the front) your dimension:

     =match([City],concat(distinct [City],','))



Now if you'll excuse me, I have an after-funeral party to attend.

No comments:

Post a Comment