marketo smart list filters exclude matching records - marketo

Is there a way to use the smart list in a campaign to exclude records that match a filter?
I've got a custom table linked to the lead records, but it's a many-to-one style. I'm trying to suppress lead records where the history records match certain values.
Problem is that there seems to be no way to do it. I can have it include leads with no history records or leads with history records without certain values, but if the same lead has multiple history records, it will show up if either record has a value not in the exclusion.
What I want is the leads where NONE of the history records for it has those certain values, not simply to exclude the history records that match.
If this were a sql join statement, what I'm getting is:
select * from leads
join history on history.leadid = leads.id and history.myval != 'x'
but what I want is:
select * from leads
where id not in (select id from history where myval = 'x')

You might be able to do it by creating a couple of smart lists
a> A smart list that will checks for all the people who have that custom object AND have the exact value(s) that you want to Exclude
b> Then create another smart list with criteria like,
All the people who have,
1> That custom object
AND
2> Who are NOT in the first smart list A
That should give you the people you are looking for
Hope this helps
Rajesh Talele

Related

check duplicate values in oracle forms multi record block

What I wanted is to display an alert when I move to the next row if the record that I inserted is already one of the records in the multi record block.
and in what trigger must I put it?
There are several options you can use.
One is to POST values entered (in WHEN-NEW-RECORD-INSTANCE) trigger. It will, well, post everything you entered so far. Then, you can write a WHEN-VALIDATE-ITEM trigger which SELECTs from that table and checks whether such a value already exists. Alternatively, if there's the UNIQUE CONSTRAINT on that (those) column(s), database will do its job itself, i.e. raise an exception.
Another option is to literally loop through all rows in a block and compare the first row's value with all the others, then the second row's values with all of them, etc.
Or, you can use a Record Group (usually used for Lists of Values). Basically, you'd check whether value you entered exists in a record group. More info, along with a FMB file, on Craig's blog.
Or, you can use calculated items, as described enter link description here (FMB attached as well).
As you can see, quite a few ways to do that; explore each of them and pick the one you find the most useful / attractive / easy to implement.

Missing values in google.com:analytics-bigquery:LondonCycleHelmet.ga_sessions_20130910

I am working with the practice repository in preparation for doing upcoming work with a large enterprise client using BQ. The repository link is: google.com:analytics-bigquery:LondonCycleHelmet.ga_sessions_20130910
I have 3 questions to ask in relation to the sample repository & a query that was run (please see the bottom of the link for the query that motivated the question:
1) What is the difference between customDimensions.index, customDimensions.value and hits.customDimensions.index, hits.customDimensions.value?
2) If a single hit has multiple custom dimensions/metrics how is that returned/queried? I only see single dimensions matching at the hit level in the sample data.
3) There are no custom metric values passed in the example data, what will those values look like?
Here is the query that motivated the previous 3 questions:
SELECT hits.page.pagePath AS urls,
hits.time,
customDimensions.index,
customDimensions.value,
hits.customMetrics.index,
hits.customMetrics.value,
trafficSource.medium,
hits.customVariables.index,
hits.customVariables.customVarName,
hits.customVariables.customVarValue
FROM [google.com:analytics-bigquery:LondonCycleHelmet.ga_sessions_20130910]
Every record in that table represents one Google Analytics Session. Big Query has this concept of nested fields and that's how individual hits are defined. They are nested into the hits record.
Answering your questions:
1) customDimensions.index and customDimensions.value are the index and value for user or session scoped custom dimensions. hits.customDimensions.index and hits.customDimensions.value re custom Dimensions set at hit scope level. The scope is defined when you create the custom Dimension through GA interface. indexes are integers from 1 to 20 (as defined in the Admin section) and value is the string passed as the value for that custom Dimension. More info about Custom Dimensions/Metrics
2) Both rows and rows.customDimensions are REPEATED RECORDS in Big Query. So in essence every row in that BQ table looks like this:
|- date
|- (....)
+- hits
|- time
+- customDimensions
|- index
|- value
But when you query the data this should be FLATTEN by default. Because it's flatten if a single hit has multiple custom dimensions and metrics it should show multiple rows, one for each.
3) Should be the same as customDimensions but the values are INTEGER instead of STRINGS.
For a simpler and more educational dataset I suggest that you create a brand new BQ table and load the data provided on this developer document page.
PS: Tell my good friends at Cardinal Path that Eduardo said Hello!

Crystal Report with Multiple Tables - Empty or Cartesian Product

I know this has been asked before..sort of. And that's why I'm posting. Basically I'm building a report in Crystal that relies, to keep this simple, at least 3 tables.
Table A is inner joined to table B by a unique ID. Table B has a child table that may or may not have data related to this unqiue ID.
As a general example table A is a customer table, table B is a product table and the child table is contains the product number. All customers have a product, but not all customers have product number in the child table. I hope I've explained that simply enough.
My issue is sort of between Crytal and Access and how to query this. When I'm writing behind something in VB it's easy enough to write and execute a query and display the result in the desired manner. However I can't seem to get my query straight... I either end up with a report with cartesian product as the resultset, which displays ok...except that even with the few records I have ends up being about 30k pages..or I end up with a blank dataset because the child table does not have corrisponding data to B.
Using outter joins I've managed to get my results within some amount of reason but not acceptable to a real world report. I'm sure this issue has come up but I can't seem to find any suitable answers and to be honest I'm not even sure what questions to ask being a Crystal n00b.
What I'm really after is the data from Table A, the data from Table B and children tables. While they are logically linked and can be linked with the ID field, it isn't necessary I don't think because I am taking a parameter value for the report of the ID field. And once the tables are filtered, no other action needs to be taken except to dump them back on the report.
So can anybody point me in the right direction? Can I set up individual datasoruces (unrelated) based perhaps in a seperate section? Should I build a tree of queries and logic in my DB to get what I need out? I've been racking my brain and can't seem to find the right solution, any and all advice is apreciated and if I can clarify anything or answer any questions I will.
Thanks in advance.
As per requested below:
Section1
ID fname lname
01 john smith
Section2
ID notifiedDate notifiedTime
01 10/10/2012 12:35PM
S2childAdmin
ID noteName
01 jane doe
This data is logically related and can be related in the DB. However it is not necessary as long as the ID parameter is passed to each table. Querying Section1 inner joined with Section2 works fine. But any other arrangements result in more rows than required and I end up with a report many times duplicated. What I really need is something like Section1 joined with Section2 and S2childAdmin as a freely availble table. Otherwise it multiplies my data or results in a null recordset (because it can return 0 rows)
I think this should help point you in the right direction, though it has been 5 years or so since I did heavy Crystal Reports work.
One option might be to join everything using Outer Joins like you stated you were, then use a Crystal Report 'group' on the Table A ID, with a group based upon Table B ID inside of that. So you would, in the actual 'Detail' area put your table C details if there were any, and then use the Group header/footer for Table A and Table B to show data specific to those objects.
Another possible solution that may fall short of your requirements but might get you thinking in another way, is to create your main report and in it, display the fields from table A. Then below those fields include a sub-report and pass in the unique ID from Table A. You will then have a query inside of the subreport that finds all of the Table B records with that Table A.ID value and displays their details.
At this point you run into a weakness of Crystal Reports (at least as of the last version I used) in that you cannot have a subreport inside of a subreport.

Drupal create views involving LEFT JOIN Sub-Select with non-existent node

i'm using Drupal 6
I have this table relation and I've translated into CCK complete with it's relation.
Basically when I view a Period node, I have tabs to display ALL Faculty nodes combined with Presence Number.
here's the table diagram: http://i.stack.imgur.com/7Y5cU.png
Translated into CCK like these:
CCK Faculty (name),
CCK Period (desc,from,to) and
CCK Presence(node-reference-faculty, node-reference-period, presence_number)
Here's my simple manual SQL query that achieve this result: http://i.stack.imgur.com/oysd3.png
SELECT faculty.name, presence.presence_number FROM Faculty AS faculty
LEFT JOIN (SELECT * FROM Presence WHERE Period_id=1) AS presence ON faculty.id=presence.Faculty_id
The value of 1 for Period_id will be given by the Period Node ID from the url argument.
Now the hardest part, is simulating simple SQL query above into Views. How can I make such query into Views in Drupal-6 or Drupal-7 ?
thanks for any helps.
The main issue, which I think you've noticed, is that if you treat Faculty as the base for your join, then there is no way to join on the Presence nodes. Oppositely, if you treat Presence as the base, then you will not see faculties that have no presence number.
There is no easy way, using your currently defined structure, to do these joins in views.
I would say your easiest option is to remove the 'node-reference-faculty' field from the presence node and add a node-reference-presence field to the faculty. Since CCK fields can have multiple values, you can still have your one-to-many relationship properly.
The one downside of this is that then you need to manage the presence-faculty relationship from the faculty nodes instead of the presence nodes. If that's a show stopper, which it could be depending on your workflow, you could have BOTH node-reference fields, and use a module like http://drupal.org/project/backreference to keep them in sync.
Once you have your reference from faculty -> presence, you will need to add a relationship in Views. Just like adding a field or a filter, open the list of relationships and find the one for your node-reference field.
Next, you will need to add an argument for period id and set it up to use a node id from the url. The key thing is that when you add the argument, it will ask which relationship to use in its options. You will want to tell it to use your newly added presence relationship.
You don't really need to do a subquery in your SQL like that. This should be the same thing and won't make mysql try to create a temporary table. I mention it because you can't really do subqueries in Views unless you are writing a very custom Views handler, but in this case you don't really need the subquery anyway.
Ex.
SELECT f.name, p.presence_number
FROM Faculty AS f
LEFT JOIN Presence AS p ON f.id=p.Faculty_id
WHERE p.Period_id=1;
I wrote an article about how to achieve a similar outcome here. http://scottanderson.com.au/#joining-a-views-query-to-a-derived-table-or-subquery
Basically how to alter a Views query to left join on a sub-query.

Drupal OG Views: cannot create view of all groups of which I am *not* currently a member

(Also posted as http://drupal.org/node/596860)
I would like to create a view showing only those groups of which I am not already a member (or a pending member). However, the obvious way of doing this (take the og_my view and change the filter "Organic groups: Group member" to false) does not work.
The reason is that the SQL query essentially returns one row for every user in the group that matches your conditions. If you're searching for yourself (as in og_my), each group node will only show up once; if you're not searching for yourself, each group node shows up N times, where N is the number of other group members. Thus the groups of which I'm already a member continue to be displayed as long as there's at least one other member.
Does anyone have a way around this?
Thanks, Adrian
You may not be able to achieve this in Views directly as it does not support subqueries. My SQL came out like so:
SELECT node.nid AS nid, node.title AS node_title FROM node node LEFT JOIN og_uid og_uid ON node.nid = og_uid.nid WHERE (node.type IN ('campaign','setting','system')) AND node.nid NOT IN (select nid from og_uid where uid = 1);
It is said you can programmatically forward the results of such a query into the Views system for theming.
Maybe a special handling of the argument Organic Groups:Member of a Group, Exclude Argument option?
I also posted to d.o in hopes of pushing the issue conversation onward.
Wild. OG Views Extra was made available on d.o three days after your first revision of this question. I haven't used it, but looks just like it may do it.
So why install this module? If you need finer-grained control. The
available user options:
Not a Group Member
Group Member or Site Admin
Group Member Only

Resources