Skip to main content

CM Opportunities

The CM Opportunities mapping allows you to report on the opportunities that you have in the system.

Here is a template Dataset to review and modify to your needs:

CM Opportunities Template Dataset

To import this template dataset into your system, start at step 4 in the documentation Copying a Dataset To a Different Datasource

Please note that there are some additional Flow Steps that you should remove if you are not going to use their results:

img

Template Usage Notes

There is a sample Visual in the Dataset for you to review.

The field Opp Split Price is the Weighted monthly amount. It is broken out by Month using the Start and End date on the Opportunity to calculate how many months to spread the weight amount over.

Here is the code that performs this split, the Flow step is Split Prepare:

//=========================================================================
//== We have a Start and End Date field.
//== The need is to create a row for each month between these dates and
//== equally allocate the Digital Price across those months as well as multiplying that
//== amount by a weight percentage.
//== To do this, two fields will be created OppSplitMonth("YYYY-MM")
//== and OppSplitPrice (number)
//== These fields will contain arrays that when normalized will create a "new"
//== row for each. Note, the price field will take
//== the Digital Price divided by the number of months and multiply by some weighting value.
//=========================================================================

//
startDate = $record.digitalStartDate;
endDate = !$record.digitalEndDate
? $record.digitalStartDate
: $record.digitalEndDate;
//endDate = moment($record.digitalEndDate);
//-----------AUDIT FIELD
$record.errorIssues = !$record.digitalEndDate ? "Empty End Date" : undefined;
//----------
//probabilityPercent = $record.opportunity_stages_assoc_probPct / 100;
probabilityPercent = $record.probPct / 100;

// Get the number of months between the start and end date
// zero months will return 1
diffMonths = informer.navReturnANumber(
naviga.getMonthsBetween(startDate, endDate)
);

// Make sure diffMonths is positive, if not, make zero
diffMonths = diffMonths < 0 ? 0 : diffMonths;
// $record.DIFFMONTHS = typeof diffMonths + diffMonths + endDate.format('YYYY-MM')

// Create an array with diffMonths slots each filled with the digitalPrice
// Note: digitalPrice will be multiplied by it's probability %
priceArray = new Array(diffMonths).fill(
$record.digitalPrice * probabilityPercent
);
monthArray = new Array(diffMonths).fill(startDate);

$record.OppSplitPrice = priceArray.map((price) => price / monthArray.length);
$record.OppSplitMonth = monthArray.map((sDate, idx) =>
moment(sDate).add(idx, "M").format("YYYY-MM")
);

$record.SplitLength = monthArray.length;
//$fields.monthSplit.dataType = 'string';
//$record.monthlyPrice = [100, 200, 300, 400]

function returnNumber(numberIn) {
let parsedNumber = parseFloat(numberIn);
if (isNaN(parsedNumber)) {
return 0;
}
return parsedNumber;
}

function diffMonths(startDate, endDate) {
// Returns the number of months between the startDate and the endDate
// Confige object could have:
// negativeReturn: "actual", "absolute", default is actual and if something other than passed, that is what is used
// Given how moment caclulates the difference between dates, it was returning the wrong number of months between in certain cases.
// To fix, we pass the true flag, which return a decimal that we just take the ceiling of, i.e. round up all the time
diffMonths = Math.ceil(returnNumber(endDate.diff(startDate, "months", true)));
return diffMonths <= 0 ? 1 : diffMonths;
}

User versus Rep

What is the difference between a User and Rep in Naviga Ad? The User is a System User with a login to the Naviga Ad system. Hence, you can think of the User Id being associated with a person who can log into Naviga Ad and enter campaigns, view reports, etc.

A Rep, however, is a separate id that will be associated with one or more Users. A Rep is the entity that gets credit for a campaign or is attached brand.

The reason for this is that while most of the time a Rep IS a person, sometimes that person may not have access to the Naviga Ad system (they never log into Naviga Ad) OR the Rep may be something like "House Ads Rep", which is not a person, but still technically a "rep" that is receiving credit for the campaign.

Why Does this Matter

Most of the time it doesn't. Just about every mapping in Informer has Rep information associated with the transactions.

However, when dealing with the CM Opportunities mappings, you will see an Owner User ID. These are not Reps. They are Users of the system.

Since an opportunity has not yet happened, there can be no Original Rep, but there is a User who owns it.

By Q3 of 2021, you will see some additional information available for the Owner User Id:

  • Owner Email
  • Owner Name
  • Owner Assoc Rep IDs - This is a multivalued field that contains the Reps that this User is associated with. It will link to the Owner Assoc Rep IDs mapping so that you can get more detailed information for the linked/associated reps.

User ID and Rep ID Association

As was noted above, a User ID can be associated with multiple Rep IDs.

Within Naviga Ad you can find this association in the User Setup Area.

loginuservsreps_001

Prospect Interests

image-20240116180434188

Prospect Interests are found in the CM Prospects mapping in Informer. They are tricky to work with because the Prospects mapping's key is Client Id * Rep Id.

This means that each rep could have their own Interests for a given Client/Prospect.

Meaning the best we can do is create a report that shows all reps Interest settings for a given client.

The Interest data is stored in three fields:

  • PUB.LIST <22>
  • CATEGORY.LIST <23>
  • EXHIBITION.LIST <24>