2 of 2 people found this helpful
There are plenty of ways to go at this. I must say I'm not very familiar with using the custom aspects of the filters...I'm partial to creating calculated fields to hold formulas rather than inserting them directly into the filter. That way, I can expose the result in the view if I so choose.
You could try something like this:
IF CONTAINS([DimensionField],'VRI') OR CONTAINS([DimensionField],'Tran')
Then, just drag that new field into the filter shelf and choose to expose 'Show' only.
Mark is right - you could actually use your original formula as a calculated field - it would evaluate as a boolean T/F
Yeah this is the way I ultimately went with. Thanks!
I have a question based on filter condition. I have a list of URL's with sum of page views.So I have url's in my row and there sum of page views as column. Now I have to exclude few Url's based on a specific condition, for which I created calculated field and done so. Now as a result in below screenshot I have list of Url's with respective page views and excluding what I need. Here the problem arises. I want to have top 10 of these Url's. Now I want top 10 Url's out of this view.
The problem I am facing is if I find top 10 Url's from the calculated field "Page URL Filter" it does not give top N row. If I filter original dimension Page URL decode it gives only 6 of them. I think because it is filtering on entire data and as my few URL's are excluded in calculated filed so it gives just six.
How can I get the top N url's when I have used a calculated field filter on the same dimension as used in my row.
Any help appreciated..!!
I have the same problem as Rupali.
Can anyone point me to a good resource for learning how to write custom calculations that include filters?
4 of 4 people found this helpful
So in your calculated field, which excludes certain elements, and is used to filter...if you change the filter to be 'Add to context' that will push the filter up the calculation pipeline and so get applied before the Top N is.
In an example here I show the Top 10 customers, just using the Top 10 filter on SUM([Sales])
I then create a filter calculated field to exclude certain elements (Sean and Tom)
add this to the filter shelf and set to true...and now I only have 8 people in my top 10...as you've experienced
However I now set the [dummy filter] to 'Add to context'
and I'm back at 10 again, minus Sean and Tom
an alternative on this theme, would be to create a calculated measure for your filtered list. so in my example I've done
[Sales Exclude Filtered]
I then use this in my Top N filter (not the original SUM([Sales]) measure, and again I'm back to 10 members, minus Sean and Tom
Hope that does the trick for you, else for full Top N flexibility you'll probably need to use RANK or INDEX, which (as you say) means you'll need (in my example) [Customer Name] in the VizLoD.
Thanks for the detailed answer that helped. Although I have to submit it little earlier.
Although I have to submit it little earlier
...not sure I understand...are you referring needing the filter applied earlier than a context?...
Sorry for misunderstanding. Just wanted to say I submitted the assignment two months back..
No probs!...just wanted to check you had the solution you need!...I hadn't realised it was such an old thread!
I have almost similar situation but my filter does not work.
So I have created a custom layout filter based on parameter with set of values, which has hierarchy as well. In the code for parameter, I have upto 4 character codes. From the database / query, I have result on the sheet, and when I put the field on filter card, set the Condition -> By Formula -> as "Contains ([FindStateVal], [StateCodes]), for all selections it work, but when I select "All", it blanks out. This is because there is no such value in StateCode field as "ALL".. That All needs to be all the values to be used.
Is there a way to write conditional criteria in Filter screen somewhere to ignore CONTAIN formula in case of "All" ?
The issue is I have hierarchy of Area -> Region -> State and instead of showing 3 filters on dashboard which would take up lot of space, I had thought of this approach.
Any help would be greatly appreciated..
How does the Contain filtered set would work, if someone selects the value with "VRI"? I replicated that for my situation and it works fine when "All" is selected, but otherwise blanks out. I actually posted my situation.
So I have an excel file with a column with text. I want to be able to search that column based on certain parameters and then label it into a specific "bucket" label. Below an example of the terminology I am looking to filter but don't know how the terminology will work on a If and else statement. Here is how I want to filter out to specific Label by word searching an excel column:("eng" or "eng1" or "eng2" or "eng3" or "eng4" or "engine" or "engines" ) and ("shut down" or "shutdown" or "IFSD") and ("atb" or NEAR(("emerg*", "declar*"), 2, FALSE) or "diver*" or "turn back" or "turnback" or "turned back" or "mayday" or "may day" or "21.3") and not (NEAR(("no", "shut*"), 2, TRUE) or NEAR(("not", "shut*"), 2, TRUE) or NEAR(("apu", "shut*"), 2, FALSE) or NEAR(("no", "emerg*"), 2, TRUE)) I Thank you ahead of time.So I got Half way there but I still need help below what I got so far: IF (CONTAINS([Event Description],'eng') OR CONTAINS([Event Description],'eng1')OR CONTAINS([Event Description],'eng2')OR CONTAINS([Event Description],'eng3')OR CONTAINS([Event Description],'eng4')OR CONTAINS([Event Description],'engine'))AND CONTAINS([Event Description],'shutdown' )THEN 'Engine Shutdown'ELSE 'TRY AGAIN'ENDMy problem is that I need to add more 'keywords' to the AND part of the formula as OR type. For Example : AND CONTAINS ([Event Description], 'Shutdown' or 'Shut down' or 'Emer' or......)HELP
So with regards the ORs and ANDs...you can use brackets to group ORs within ANDs. So in the example you gave
(CONTAINS ([Event Description], 'Shutdown' or CONTAINS ([Event Description],'Shut down') or CONTAINS ([Event Description],'Emer'))
So in this case the IF statement will only equate to true if
any of the CONTAINS ([Event Description]) logic are true.
One other thing that might remove a few tests, would be to upper the [Event Description] and then the CONTAINS test
CONTAINS (UPPER([Event Description]), 'SHUTDOWN')
Hope that helps