Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

saranrajk
New Contributor

How to do sort by expression using qlik sense .net sdk

Hi, I wanna sort the columns based on values( example: sales by city), how to do it using .net SDK

3 Replies
Employee
Employee

Re: How to do sort by expression using qlik sense .net sdk

There is a project available on branch that illustrates how to use hypercubes:

Qlik Branch

In particular, check out this method that illustrates how to configure sorting of a hypercube:

qlik-dot-net-sdk-hypercube-usage/Program.cs at master · kolsrud/qlik-dot-net-sdk-hypercube-usage · G...

saranrajk
New Contributor

Re: How to do sort by expression using qlik sense .net sdk

Hi, thank you for your response, But I'm still lagging with that, can I have code samples for sorting the value in column(eg: salary of the employee, I wanna sort their salaries in descending order)

Employee
Employee

Re: How to do sort by expression using qlik sense .net sdk

What are you lagging with? Hypercubes? If that is the case, then now is the time to read up on it . Hypercubes are what we use for doing that type of operations in Qlik Sense. If you have a hypercube that contains "City" as dimension and "Sum(Sales)" as measure, and want to sort the rows by the sales (descending), then you need to configure your hypercube like this:

// Configure measure to sort descending:

hyperCube.Measures.First().SortBy = new SortCriteria {SortByNumeric = SortDirection.Descending};

// Configure cube to sort on measure first:

hyperCube.InterColumnSortOrder = new[] { 1, 0 };

This is a nice example to add to the hypercube example though, so I just did that. You can find the example here:

qlik-dot-net-sdk-hypercube-usage/Program.cs at master · kolsrud/qlik-dot-net-sdk-hypercube-usage · G...

Community Browser