Bondski.QvdLib 2.2.0

dotnet add package Bondski.QvdLib --version 2.2.0
                    
NuGet\Install-Package Bondski.QvdLib -Version 2.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Bondski.QvdLib" Version="2.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Bondski.QvdLib" Version="2.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Bondski.QvdLib" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Bondski.QvdLib --version 2.2.0
                    
#r "nuget: Bondski.QvdLib, 2.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Bondski.QvdLib@2.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Bondski.QvdLib&version=2.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Bondski.QvdLib&version=2.2.0
                    
Install as a Cake Tool

qvdlib

About the project

This is a library for dealing with QlikView Data Files (short: QVD) from .NET. They are the only easy way to write data from Qlik Script other than CSV which has its own issues. It is a proprietary binary format that (as far as I know) is not publicly documented. However, there are implementations in C (https://github.com/devinsmith/qvdreader) and Python (https://github.com/korolmi/qvdfile).

It is more of a personal project for fun, but done in the hope, that something useful will come out of it. For now, it is only able to read the XML header which can easily be accessed in each file.

Getting started

You can download this from nuget under the name Bondski.QvdLib (https://www.nuget.org/packages/Bondski.QvdLib/1.0.0).

To read a qvd file, simply do something like this:

QvdReader qvdReader = new QvdReader("/path/to/file");
while(qvdReader.NextRow())
{
  Console.WriteLine(qvdReader["ColumnName"].ToString());
}

When using the library, it is important to understand the Qlik type system, as it has implications for the values you will be getting. Especially, there is no way of verifying that all values in a given field are of the same type.

There are the followng types in Qlik: |Type|String|Int|Double| |---|---|---|---| |String|X|-|-| |Integer|-|X|-| |Double|-|-|X| |Dual Integer|X|X|-| |Dual Double|X|-|X| |Null|-|-|-|

For performance reasons, Integer and Double values are always stored as primitives, so they are not nullable. So if you want to use the properties for Int and Double, you have to check the type of the value yourself to handle null values correctly.

The recommended way is to use the appropriate AsX- and ToX- methods provided by the Value class. These work as follows:

String Int Double DualInt DualDouble Null
AsString X - - X X (null)
AsInt - X - X - (null)
AsDouble - - X - X (null)
ToString X X X X X (null)
ToInt(true) X X X X X (null)
ToInt(false) - X X X X (null)
ToDouble(true) X X X X X (null)
ToDouble(false) - X X X X (null)

For dual types, both AsX- and ToX- methods will use either the numeric or the string representation. The ToX-methods use System.Convert for conversions.

Roadmap

For now, the library does what it is supposed to, it reads qvd files. Right now, I am mostly looking to:

  • test the library on as many qvds as possible and fix any issues that come up. If you have a file that is not read correctly, please open an issue.
  • Improving the unit test coverage (especially for value reading there are quite a few holes)
  • A few optimizations

Maybe, at some point in the future, I will implement writing qvd files.

License

Licensed under the Apache License 2.0.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net9.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.2.0 270 7/13/2025
2.1.0 458 5/17/2023
2.0.1 592 8/26/2021
2.0.0 485 8/25/2021
1.0.0 525 6/27/2021

Actually fix bug with field orders when reading from qvd's (thanks to DubMatrix).