Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
vweilandosmose
Contributor II
Contributor II

Qlik Sense Table Column Drop Down not sorting correctly

In my Qlik application, I have a date column that I want to sort descending, even in the table column drop down list.  I have loaded my date columns WeekEndingDate (YYYY-MM-DD) and WeekEndingDate#, and loaded a dual: 

...dual(WeekEndingDate,WeekEndingDate#) as [Week Ending], ...   <full script below>

I created a filter and a normal table with the dual column [Week Ending], and in both defined the sorting as numeric, descending. The sorting in the filter, its select drop down list, and the table column is sorted correctly descending, but when open the column header  selection list, it is still sorted ascending. 

Any suggestions what I should do?

Thanks, Val

Fact:
LOAD distinct
RowNo() as QID,
WeekEndingDate,
WeekEndingDate#,
dual(WeekEndingDate,WeekEndingDate#) as [Week Ending],
CrewID,
HoursWorked,
UTSV_ExtItemUnits
FROM [lib://QVD_Transform/Portal/Unit_Tracking/UnitTracking_Fact.qvd]
(qvd);

Labels (3)
3 Replies
lorenzoconforti
Specialist II
Specialist II

I believe the sorting in the search box is determined by the load order; if you really need this, you could sort your Fact table; please note order by only works on tables already loaded:

 

Fact_temp:
LOAD distinct
RowNo() as QID,
WeekEndingDate,
WeekEndingDate#,
dual(WeekEndingDate,WeekEndingDate#) as [Week Ending],
CrewID,
HoursWorked,
UTSV_ExtItemUnits
FROM [lib://QVD_Transform/Portal/Unit_Tracking/UnitTracking_Fact.qvd]
(qvd);

Fact:
NoConcatenate load * Resident Fact_temp Order by [Week Ending] desc;

Drop table Fact_temp;

vweilandosmose
Contributor II
Contributor II
Author

I did what you suggested, but sadly I am still getting the same result - see qvf attached.

lorenzoconforti
Specialist II
Specialist II

See attached; not very elegant but it works. Basically the objective is to create a field (in this case WeekEnding#4) that is sorted in descending order and that is a dual value (with the numeric value being the sorting order)