converting a column

Hi


I am looking at converting a column of data which is a combination of 2 letters and then 2 numbers to just the 2 letters.

i want to be able to view the information in graph in powerview.

so basically i have 4 bins of 2 letters. AA, BB, CC & DD and they can have up to 99 number combinations with them i am not interested in the numbers i just want to be able the count the letters,
ideally it would look like this. 

zone type
aa01 aa
aa02 aa
aa03 aa
bb01 bb
cc01 cc
dd01 dd
dd02 dd
dd03 dd

Or at be able to count how many aa, bb etc there are in the zone.

Any help will be much apprenticed

Cheers

Dan

February 13th, 2015 8:46pm

Are you looking for the below?

create table test_Sample(zone varchar(4))
Insert into Test_Sample Values('aa01'),('bb99')

Select zone, substring(zone,1,2) type From test_sample

Drop table test_Sample

Free Windows Admin Tool Kit Click here and download it now
February 13th, 2015 9:59pm

Are you looking for the below?

create table test_Sample(zone varchar(4))
Insert into Test_Sample Values('aa01'),('bb99')

Select zone, substring(zone,1,2) type From test_sample

Drop table test_Sample

cheers for the quick response!
i am totally new to powerpivot (since Thursday) so am a little out of my depth with your suggestion.
I have created a sample table with the example i gave above. But i'm not sure what you want me to do next.



February 13th, 2015 10:22pm

If you're looking at powerpivot DAX expression then you need to use this

COUNTX(FILTER([TableName],EARLIER(TableName[type]) == TableName[type]))

Free Windows Admin Tool Kit Click here and download it now
February 14th, 2015 6:14am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics