Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Violent_Democracy
Contributor
Contributor

Count the value change in a column

Hi,

I have the following dataset:

FacilityRefNoTenancyRefNoTenantNameUnitNoStreetNoStreetNameSuburbPostcode
1000014823MR DAVID SMITH11FIRST STBLUEBIRD2000
1000015001MISS KELLY JOHNSON11FIRST STBLUEBIRD2000
1000015001MISS KELLY JOHNSON11FIRST STBLUEBIRD2000
1000033006MISS LESLEY HUGHES 13KINGFISHER STSTARLING2001
1000033006MISS LESLEY HUGHES 13KINGFISHER STSTARLING2001
1000033006MISS LESLEY HUGHES 13KINGFISHER STSTARLING2001
1000040606MR TONY ADAMS 12WATSON STGOTHAM2002
1000048787MR SIDNEY CROSBY 12WATSON STGOTHAM2002
1000049999MR WAYNE GRETSKY 12WATSON STGOTHAM2002

I would like to add a column to the table that shows the number of TenancyRefNo changes that occur in FacilityRefNo.

FacilityRefNoTenancyRefNoChangesTenantNameUnitNoStreetNoStreetNameSuburbPostcode
10000148231MR DAVID SMITH11FIRST STBLUEBIRD2000
10000150011MISS KELLY JOHNSON11FIRST STBLUEBIRD2000
10000150011MISS KELLY JOHNSON11FIRST STBLUEBIRD2000
10000330060MISS LESLEY HUGHES 13KINGFISHER STSTARLING2001
10000330060MISS LESLEY HUGHES 13KINGFISHER STSTARLING2001
10000330060MISS LESLEY HUGHES 13KINGFISHER STSTARLING2001
100004`06063MR TONY ADAMS 12WATSON STGOTHAM2002
10000487873MR SIDNEY CROSBY 12WATSON STGOTHAM2002
10000499993MR WAYNE GRETSKY 12WATSON STGOTHAM2002

I have tried to add a new measure called Tenancy change and use the expression

Sum(Aggr(count(DISTINCT TenancyRefNo),FacilityRefNo))

but it didn't quite give me the output I was expecting at times, also I need to be able to filter on the column as well.

Is anyone able to assist me further here?

Thanks

1 Solution

Accepted Solutions
Vegar
MVP
MVP

Try this

count(TOTAL <FacilityRefNo> DISTINCT TenancyRefNo)

View solution in original post

4 Replies
Vegar
MVP
MVP

Try this

count(TOTAL <FacilityRefNo> DISTINCT TenancyRefNo)

Violent_Democracy
Contributor
Contributor
Author

Thanks for that, worked brilliantly.

Vegar
MVP
MVP

Glad to be of help.

Have a good day.

/Vegar

basav
Creator
Creator

Hi, 

You have selected the wrong post as an answer, please select the post of Mr.Vegar with the solution. Thank you. 

cheers,

Basav