Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
akpofureenughwu
Contributor II

sort data by apply map

Hello everyone,

I have two data in the form

Data Table

ridNameClassvbatchId
1John LeeSS3Asdioe12d
2Katty JennySS1dfoemd1340d
3Jhon BrownSS1Dfthgkdwo45ty
4Owen GreenDD6AFgeiwo56h

Verification Table

ridvbatchIdStatus
1Asdioe12dTrue
2dfoemd1340dFalse
3Dfthgkdwo45tyFalse
4AFgeiwo56hTrue

The design I am to visualize only data that their vbatchId status is equal to 'True'

I am trying using ApplyMap but it's not working. I need help 

1 Solution

Accepted Solutions
antoniotiman
Honored Contributor III

Re: sort data by apply map

Hi Akpofure,

maybe thsi

LOAD rid,
Name,
Class,
vbatchId
FROM
"https://community.qlik.com/message/1329296"
(html, codepage is 1252, embedded labels, table is @1);
Inner Join LOAD rid,
vbatchId,
Status
FROM
"https://community.qlik.com/message/1329296"
(html, codepage is 1252, embedded labels, table is @2)
Where Status
= 'True';

Regards,

Antonio

7 Replies

Re: sort data by apply map

Try to show expected result from this table or post your Applymap code to better understand

Life is so rich, and we need to respect to the life !!!
akpofureenughwu
Contributor II

Re: sort data by apply map

ridNameClassvBatchId
1John LeeSS3Asdioe12d
2Owen GreenDD6AFgeiwo56h

since their vBatchId hold 'True in the verification table

Regards

simotrab
Contributor II

Re: sort data by apply map

Hi,

applymap applies a mapping on data, the result should be something like:

Verification Table

ridvbatchIdStatus
1Asdioe12dTrue
2dfoemd1340dTrue
3Dfthgkdwo45tyTrue
4AFgeiwo56hTrue

ApplyMap ‒ QlikView

If you want to visualize only the True status you ought to add a Where clause in your load script.

However, if you need a mapping it should be something like:

Mapping:

Mapping Load Old, New Inline

[Old, New,

'False', 'True'

];

Load

rid

,vbatchid

,(ApplyMap('Mapping', Status) as Status

;

sql select

*

from Verification Table;


akpofureenughwu
Contributor II

Re: sort data by apply map

Simone.. Thanks but you didn't get the verification table well.. Please look at it carefully

simotrab
Contributor II

Re: sort data by apply map

Thanks, my mistake, maybe this, joining the two table.


If you want only the True on the data table, looking the verification table, you could do this:

load

d.rid

,d.name

,d.class

,d.vBatchid

;

sql select

*

from data table d

join Verification table v on d.rid=v.rid

where Status = 'True'

;


antoniotiman
Honored Contributor III

Re: sort data by apply map

Hi Akpofure,

maybe thsi

LOAD rid,
Name,
Class,
vbatchId
FROM
"https://community.qlik.com/message/1329296"
(html, codepage is 1252, embedded labels, table is @1);
Inner Join LOAD rid,
vbatchId,
Status
FROM
"https://community.qlik.com/message/1329296"
(html, codepage is 1252, embedded labels, table is @2)
Where Status
= 'True';

Regards,

Antonio

vishsaggi
Esteemed Contributor III

Re: sort data by apply map

May be this?

As you have vbatchId as common field in both the tables auto concatenation happens then using straight table try like below:

Table1:

LOAD rid,

     Name,

     Class,

     vbatchId

FROM

[https://community.qlik.com/thread/271892]

(html, codepage is 1252, embedded labels, table is @1);

Table2:

LOAD rid AS Ver_rid,  // Rename this field so that the tables can connect using vbatchId field.

     vbatchId,

     Status

FROM

[https://community.qlik.com/thread/271892]

(html, codepage is 1252, embedded labels, table is @2);

Using straight table

Add dimensions: vbatchId, Name

Expression        : Only({< Status = {'True'} >}Status)

You will get below:

Capture.PNG

Community Browser