Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi,
I am having a filed which consists of
Name
A
B
C
D
D
but i need get them in this order
A
B
D
F
E
can we do it in script level by using the apply map can anyone help me .
thanks in advance
is its a limit set of data and you know the exact order ... first load a inline table with the same fieldname and order the data you wanted then load your actual table ,then delete the temp inline table. qlikview loads the data in same order as it loaded before. on chart you can use 'load order' on sorting options.
Take a look to dual(x,y) function, it is what you need
... let me know
can you please provide me the script if possible
TempTable:
load * inline
[
Fieldname
A
B
D
F
E
];
ActualTable
load * from abc..... ;
drop table TempTable;
script:
//this is how your mapping table looks like and this is an example
MapDOW_master:
Mapping LOAD * INLINE [
Day, Day of Week
1, 1
2, 2
3, 3
4, 4
5, 5
6, 5
7, 5
];
//In your main table your column script will be like this
applymap('MapDOW_master', CalendarDayoftheWeek)) as Daynumber....
it worked for me.
if i take a list box it is showing in the order i need.
but i am combining 2 other fields and showing them in one multi box as selection.
TempTable:
load * inline
[
Fieldname
A
B
D
F
E
];
ActualTable
load * from abc..... ;
LOAD DISTINCT No,
'1|' & [Name] as Sort,
[Name] AS Selec
RESIDENT Dim ORDER BY No ASC;
drop table TempTable;
this is what i am using
when i take the Selec filed into multi box and in the sort tab when i choose the options
it is not getting i am getting all the names in the alphabetical order
i tried this method but it did not work in my case.
sorry ... i dont get it. why are you using the sort field and using expression sort when you select load order ?
some solutions
1) use this before loading the field (in any table): this is the load order you can set in sort tab
load * inline [
Name
A
B
D
F
E
];
2) recreate the field and use in sort tab load order
source:
load * inline [
Name
A
B
C
D
E
F
];
left join (source)
load Name,
match(Name, 'A', 'B', 'D', 'F', 'E', 'C') as FieldOrder
resident source;
rename Field Name to NameOrig;
final:
noconcatenate load
NameOrig as Name
Resident source
order by FieldOrder
;
drop field FieldOrder;
3) use dual and then sort the field in sort tab by Numeric Value (the second field= Sort)
load dual(Name, Sort) as Name inline [
Name, Sort
A,1
B,2
C,3
D,6
E,5
F,4
];