Categories » Snippets

A nifty little tool to find all the distinct values in all columns

A few months ago I became quite frustrated because I had a huge backlog of work to do performing the Quality Control of the analyses of my team members. A large portion of performing this type of Quality Control was getting a sense of the data ingested by the analyses and determining if there were […]

Creating anonymized pseudo-random IDs

I sometimes need to convert a series of unique sensitive IDs into a list of unique IDs which I can use to share with people who aren’t allowed to know the IDs in the first list. The very easiest was to do that in SQL is to either use the HASHBYTES function in T-SQL and […]

Pivoting a table when you don’t know how many columns you need with dynamic SQL

Here’s the situation, you’ve got a column in a table which you want to pivot on but you don’t have any control over the distinct number of values that can be in that column. It could be 3 or it could be 20. However, you still need to be able to pivot the whole table […]

How to include several values in one field in SQL

I found out the other day how to solve a problem that had been causing me issues when presenting data. I often got requests to resent data in such a way that we display information from a table in a grouped form while still allowing someone to consult all of the values relating to this […]

Getting the number of lines in multiple csv files with Powershell v1

To find out the number of lines in each file of a bunch of csv files in the directory tree you can run the following snippet:

A function similar to first or last from access in MS SQL

I’ve been looking for a while now to find a way to return just one row when the fields I am using split up my table return several rows per unique field combination. I found this little gem today:

This of course does not emulate first and last exactly as it doesn’t really allow […]

Finding hidden characters in Excel

Did you know that you could search for hidden characters and replace with hidden characters in excel? Simply type:

To find any non-printable characters.   Here are some handy Ascii codes:

Zen and the Art of Motorcycle Maintenance and the Oxford Tutorial System

On my way back from the barracks in the middle of nowhere Switzerland I was reading ”Zen and the Art of Motorcycle Maintenance” by Robert M Pirsig. In this book at one point the argument is made by one of the characters that to remove the hypocrisy from the University system students should not have […]

An interesting Idea on why some people can’t draw

This idea comes from two main sources, ”Zen and the Art of Motorcycle Maintenance” and ”Drawing with the Left Side of the Brain” as well as my own observations. I’m not a particularly good artist and I’m a novice drawer at best. But that I believe put me in the perfect position to make the […]

The Power of List Making

I’ve never been stellar at time management. I always seem to bite off more than I can chew when it comes to work and projects. Recently, however, I’ve managed to stay on top of some pretty daunting time management tasks. Over the past month I’ve been juggling working on my masters thesis, working on a […]