Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sorting of Data from txt file which is arranged randomly !!

Hi, I want to seperately display each data item included in a 'txt' file with delimiter ";" according to type such as Name, Address, Phone etc.

As per my client's need the data is arranged randomly but there is requirement of sorting as per its type.. I have attached an example text file... can anyone help me out... Please

7 Replies
Not applicable
Author

Hi,

in chart, list box or table properties there is Sort tab, where you can define how to sort data before displaying.

You can also sort data in script, during loading process. One way would be:

table:

LOAD @1 as a,

     @2 as b,

     @3 as c

FROM

Txt11.txt

(txt, codepage is 1250, no labels, delimiter is ';', msq);

NoConcatenate

table1:

load a, b, c Resident table order by a, b , c;

drop Table table;

regards

Not applicable
Author

Hi, Thanks for your concern buddy.. but I m still unable to sort the data  in correct format..

Not applicable
Author

Can you attach qv file?

Not applicable
Author

hi again....

i am giving u sample data and the type of solution needed.

data in txt file is

john perkin ; 9890098900 ; beverly hills

london high street ; michael page ; 78007800

67007600 ; moscow road ; peter parkar

now i want this data to be filtered and displayed column wise in qlikview

like

Name             Mobile_Num          Address

john perkin      9890098900          beverly hills

michael page   78007800             london high street

peter parkar     67007600             moscow road

i am sending u the qvw file (with different data) ...plz help how to filter the data and display.  

Not applicable
Author

still waiting

Not applicable
Author

I see now, your issue is not how to sort data, but how to parse txt file. For this you should have separate table with all possible adresses (or at least city names). In load script, txt token values should be compared with them. If token contains city name, add that value to address, if contains digits, this is mobile number, otherwise name.

It requires some coding, but can be solved on described way.

regards

swuehl
MVP
MVP

IMHO, this is by far no simple task and probably very much prone to errors.

I think in your sample data, one might be able to tell the phone (number!) from the other (text!) fields by checking on numerical or text type, but telling name from addresses seems to be quite impossible, unless you can define some criteria (e.g. all addresses contain either west, south, east, north or something like this. Could be multiple criteria, can get VERY complex).

As I understood, these are also not the only fields to cope with.

As per my client's need the data is arranged randomly but there is requirement of sorting as per its type..

I am just curious, what are these client's needs that require an mix up of content in different fields?

Is there really no chance to access the (assumingly structured) data source directly (I mean, the source where this mixed up text file was generated from)?

I would rather spent some time in getting access to this source data then trying to sort these mixed up field content (unless your criteria are clear defined, see above).

Regards,

Stefan

P.S: Having a full list of possible addresses / names, as suggested above, might solve your problem, but I assume you don't have this list.