Understanding ancestry testing mathematically
I'll give here a simple, non-technical answer because I'm assuming you don't need to actually perform an analysis of ancestry. 

So, detecting ancestry is a non-trivial task. Given your genome sequence, you would need to compare some "informative" regions of the genome with the homologous sequences of some population (say, of a database with other genomes). These informative regions are usually some parts of the genome that vary across individuals (variation is used because differences are informative: some populations vary on particular sites, distinct from other populations). At the core, this is a question on how to compare "character strings" (DNA is composed of 4 characters, namely, A, T, C, and G). But these strings exist in a complicated structure: a human genome is partitioned in 23 pairs of chromosomes, within each individual. However, the question of ancestry is not about individual sequences really, but about population-level changes in DNA composition. So, in fact, you need to consider population-level factors: size of the populations to consider, the rates of recombination (DNA exchange across chromosomic pairs), mutation rates, and even population structure (people move geographically!). 

Given these (and, many other) factors, people build models of "coalescence": given a sequence of interest, how likely is that it shares some ancestor with another query sequence? So, the models try to relate these two sequences (say, the one you are interested), with a query (say, a "consensus" Scandinavian sequence), and then make a model of a 3rd sequence (the ancestor!). This process is repeated to test many hypothesis, so you end up with many probabilities. On top of this, you can estimate the ancestry for any given part of your genome, and this is what most companies do (say, 23 and me).

In summary, you are correct that a "% Scandinavian" does not mean sequence similarity per se. It implies an estimation of common ancestry. This estimation comes from models of shared ancestry. If you're unsatisfied with this simple answer, and want a more technical answer, I recommend reading this paper. An intermediate-level explanation is found here.