Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
saranrajk
Contributor II
Contributor II

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
Øystein_Kolsrud
Employee
Employee

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
Contributor II
Contributor II
Author

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)

Øystein_Kolsrud
Employee
Employee

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...