Skip to main content
Announcements
YOUR OPINION MATTERS! Please take the Qlik Experience survey you received via email. Survey ends June 14.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How do we load data in the text format

New to QlikView

Hi I am getting some data in flat file in the given format and i want to load these data in a tabular format with two columns Say used % and Description

if the usage % is 100 then there will not be any other line but if its lesser then it will show the components which are not being used .

so i want to capture the usage % in used % colum and component in description

3 Replies
fvelascog72
Partner - Specialist
Partner - Specialist

Hi,

Try this:

DATA:

LOAD

  Usage%,

  If(Usage%=100,null(),Description) as "Description"

Inline [

Usage%, Description

100, XXX

98, YYY

];

Not applicable
Author

hi The file may not be static  and values may change but data will be same format ...i need to load dyanically using transformation

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try this script

Data:

LOAD DISTINCT *;

LOAD

If(WildMatch(@1, 'Usage*'), Trim(SubField(@1, '=', 2))) AS Usage,

FileName() AS FileName

FROM

[SAMPLE*.txt]

(txt, codepage is 1252, no labels, delimiter is '\t', msq)

WHERE WildMatch(@1, 'Usage*');

LEFT JOIN(Data)

LOAD

If(NOT WildMatch(@1, 'Usage*', 'The following components*'), @1) AS Component,

FileName() AS FileName

FROM

[SAMPLE*.txt]

(txt, codepage is 1252, no labels, delimiter is '\t', msq)

WHERE NOT WildMatch(@1, 'Usage*', 'The following components*');

DROP FIELD FileName;