Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
ankitaag
Partner - Creator III
Partner - Creator III

Null values needs to be sorted at last..if replaced with some value

Hello All,

My script is

Mappingtable:

Mapping Load

Id,Region

from excel1;

Table 1:

Load Id,Name,Login Date,countofLogins, applymap('Mappingtable',Id,'Unknown') as Region

from excel2;

Here, since I have used 3rd parameter as Unknown so null values will be replaced with Unknown.

Problem is :

At frontend when I sort my table on the basis of countofLogins..Unknown comes 1st in the Region as it contains the maximum of count.

Is there any way to keep it at last?

Hope I made it clear..

Thanks and Regards,

Ankita

14 Replies
Not applicable

hi

try this , hope this will help you

Mappingtable:

Mapping Load

Id,Region

from excel1;

 

Table 1:

load *,

if(Region ='Unknown',dual(Region,1000),Region) as Region_new;

Load Id,Name,Login Date,countofLogins, applymap('Mappingtable',Id,'Unknown') as Region

from excel2;

Note:- here let us consider 1000 is the last row number of region field. you can change accordingly.


Thanks & Regards

vishwaranjan

MarcoWedel

Hi,

maybe you could sort Region by expression:

Sum(If(Region='Unknown',0,countofLogins))

hope this helps

regards

Marco

anbu1984
Master III
Master III

Check this app

CELAMBARASAN
Partner - Champion
Partner - Champion

Use Sort by Expression for Region as Ascending with Expression below

=Match(Region, 'Unknown')

Hope it helps

Celambarasan

marcus_sommer

With a dual-field you have both a string-part (could be a number, too) which it showed normally within the dimension and an additional numeric part. Those fields could then simply sorted as number.

Dual & Exists – Useful Functions

How to use- Dual()

- Marcus