I have a table called 'Car', in it i have a column called PolicyLink. the PolicyLink column contains numbers such as 445577, 445578, 445579, 445579, 445579. I am trying to associate how many cars are on a policy and what number that car will be given on the policy so I have a PolicyLink number and if it repeated more than once then the numbers will go in sequencial fasion until there is a new policy.
PolicyLink --------------------- Car Number
445577 --------------------- 1
445578 -------------------- 1
445579 --------------------- 1
445579 --------------------- 2
445579 --------------------- 3
here i have 3 policies so i have the first policy having one car, second having one car, and the third having three cars and so on and so forth. I am looking for a formula to insert into a new column in PowerPivot called 'car number'. the number under PolicyLink is PolicyLink and the -- just represent a change in column, so there is a column called 'car number' with single digits in it. Any help is appretiated
Last edited by amotto11; 08-24-2011 at 08:30 AM.
PowerPivot?
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel Tips & Solutions, free examples and tutorials why not check out my downloads
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
yes this is in powerpivot, sorry i changed my original question because i was under the impression of one thing when i needed to be looking at another. any hel p is greatly appretiated
Do you have a numeric ID column in your Cars table? If so, you could use something like:
=COUNTROWS(filter('Cars','Cars'[PolicyLink]=earlier('Cars'[PolicyLink]) && 'Cars'[ID]<earlier('Cars'[ID])))+1
is there any way to do it without a nemeric id column, if not, what would i need to do to create one?
In any well-structured database you should have a numeric ID field. Where is your data coming from originally?
well i have multiple tables, each having a primary key of its own and each having foreign keys. My table 'Policy' has a PolicyLink that is its primary key(unique numbers). In my table 'Car', there is a primary column that is called CarID, and what i am using as my foreign is the PolicyLink column and I have a relationship through that with my table 'Policy'.
Then you can use CarID
thank you!
If you are satisfied with the solution(s) provided, please mark your thread as Solved.
How to mark a thread Solved
Go to the first post
Click edit
Click Go Advanced
Just below the word Title you will see a dropdown with the word No prefix.
Change to Solved
Click Save
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks