5 Replies Latest reply on Aug 16, 2016 10:05 AM by Erin Gehn

# Is there a way to only grab the primary/first item in a field's entries?

Is there a way to only grab the primary/first item in a field's entries? An LOD calculation perhaps?

We have a function for payment. Its calculating as desired until we add a table (inner join) with a desired field. So now, that calculation is producing the output with a multiplicative for the amount of items in the new field.

Example:

calculation result:   year.a....1        new table Z with field z added result:  a....1*(number of z's per year.a)

year.b....2                                                                    b....2*(number of z's per year.b)

year.c....3                                                                    c....3*(number of z's per year.c)

Can I fix this with a LOD?

I tried..

{FIXED  [z field]:SUM([calculation])}

{EXCLUDE  [z field]:SUM([calculation])}

{INCLUDE  [z field]:SUM([calculation])}

To no avail.

Let me know your thoughts.

I apologize in advance...I'm unable to share the workbook. If the solution is not straight forward, I can spend some time trying to make a mock up in superstore. Otherwise, I can set up go-to meetings or a webex and you can play with the data while I observe?

Let me know your thoughts.

Thank you in advance!

• ###### 1. Re: Is there a way to only grab the primary/first item in a field's entries?

Hi, Erin

For me it does not seem like straight forward type solution. or difficult judge it with given information only...

If you can create dummy file, should be easier for community members to investigate...

thnaks,

Shin

• ###### 2. Re: Is there a way to only grab the primary/first item in a field's entries?

My guess is that you could try something like:

[Calculation]/{FIXED [Year] : CountD([z])}

This way, each row in the data will get a value that is equal to the original calculation, divided by the distinct number of z values within a particular year. Then, when you sum this field across all the values in the year, I think it should give you what you want. Hard to be sure without seeing the actual data though.

1 of 1 people found this helpful
• ###### 3. Re: Is there a way to only grab the primary/first item in a field's entries?

This looks like it would fix the problem exactly!!  The numbers still aren't matching 100%, but now I feel as though there must be a different issue.
THANK YOU

• ###### 4. Re: Is there a way to only grab the primary/first item in a field's entries?

You could also try it with Count[z] instead of CountD[z] in case there are duplicate values for z in your data.

1 of 1 people found this helpful
• ###### 5. Re: Is there a way to only grab the primary/first item in a field's entries?

Perhaps the duplication is not a multiplicity of the number of z's, but rather a sum of each of the z's. :/  More tricky.