Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Not applicable

HOW TO RECODE LABELS?? (part 2)

HI GUYS!

i made a post just now about recoding labels, but it wasn't accurate. basically, this is what i wanted to ask.

In my script, i placed the below expression. Now the problem is, in my chart, under the MANUF_NO column, there are different types of data.

There is blank boxes, some which say CANNOT FIND, and some with the data in it, example : KL4009, KL3008,KL5080,BX3200,BK2678 so on and so forth. so basiclly if you can understand, i want to try and split them into 3 parts, which are,

1) CANNOT FIND : which has all the CANNOT data,

2)CAN FIND : which has all the other data, KL4009, KL3008,KL5080,BX3200,BK2678 so on so forth

3) MISSING VALUE : which are the blank boxes which are displayed inside the chart.

I think i am supposed to create a variable called STATUS, and recode 3 labels under it, (the labels are the 3 above mentioned), but i'm not sure how to go about doing this.

Any ideas? Thanks! 🙂

@297:354T as [MANUF_NO]



1 Solution

Accepted Solutions
Partner
Partner

HOW TO RECODE LABELS?? (part 2)

Hey,

one solution would be to create a mapping load table, like this:



mapConditions:
MAPPING LOAD * INLINE [
Cond, Descr
CANNOT FIND, CANNOT FIND
, MISSING VALUE
];

Data:
load *,
applymap('mapConditions', MANUF_NO, 'CAN FIND') as Status;
LOAD * INLINE [
ID, MANUF_NO
1, CANNOT FIND
2
3, KL4009
4, AAAA
5, BDSS
];<div>
Hope this helps.
Regards,
Fernando


View solution in original post

9 Replies
Partner
Partner

HOW TO RECODE LABELS?? (part 2)

Hey,

one solution would be to create a mapping load table, like this:



mapConditions:
MAPPING LOAD * INLINE [
Cond, Descr
CANNOT FIND, CANNOT FIND
, MISSING VALUE
];

Data:
load *,
applymap('mapConditions', MANUF_NO, 'CAN FIND') as Status;
LOAD * INLINE [
ID, MANUF_NO
1, CANNOT FIND
2
3, KL4009
4, AAAA
5, BDSS
];<div>
Hope this helps.
Regards,
Fernando


View solution in original post

Not applicable

HOW TO RECODE LABELS?? (part 2)

Hi! Thanks for your help, but i'm not sure about the second part of this working.

Data:

load *,

applymap('mapConditions', MANUF_NO, 'CAN FIND') as Status;

LOAD * INLINE [

ID, MANUF_NO

1, CANNOT FIND

2

3, KL4009

4, AAAA

5, BDSS

];

I don't understand what this means,

Not applicable

HOW TO RECODE LABELS?? (part 2)

Hello again!

The 'CANNOT FIND' & 'MISSING VALUE' works, but the 'CAN FIND' is the problematic one.

I think it because there are a lot of data regarding 'CAN FIND'.

As in there are a lot of manufactor numbers which include KL4009, BK3008,KN2008, etc etc...

Is there a solution to put all this into one column also ? and put it under the map conditions ?

Partner
Partner

HOW TO RECODE LABELS?? (part 2)

Hey Niles,

this second part was just an example to show yout how to use the Applymap function in your Load. You must replace the 'Load * inline .....'.

If you're not familiar with it, try looking for Mapping and Applymap in QV help.

Regards,

Fernando

Partner
Partner

HOW TO RECODE LABELS?? (part 2)

Since the MANUF_NO can vary a lot, my idea to deal with the 'CAN FIND' values was to use the 3rd parameter - defaultexpr - of the applymap function.

If you want to include each MANUF_NO in the mapping table, you would have to concatenate a distinct load from MANUF_NO. But I don't think this would increase speed.

I cant think of any other solution that would dramatically increase performance...

If you're loading the data from a DB, you could put the Status logic to the DB query. But I suspect that you are not loading from a database...

Sorry but I'm not an expert yet... 🙂

Regards,

Fernando

Not applicable

HOW TO RECODE LABELS?? (part 2)

Thanks For your help Fernando!

Okay, could you help me again, now lets say in my chart, i have 6 boxes which say "CANNOT FIND' & 5 boxes which say 'MISSING VALUE'.

This is an add on about the first post.

so now...

1) 11 data .

2) 6 says 'CANNOT FIND', 5 says 'MISSING VALUE'

3)how do i add this into another box called COUNT?

so therefore, end result would be,

When click CANNOT FIND, the box beside would put 6.

Basically i want the programme to count, how many boxes there are with the display as CANNOT FIND, and display in the box called COUNT.

Do you understand what i'm trying to say ???

Thanks! i'm trying to find the solution for this now, but i can't seem to do it.

Partner
Partner

HOW TO RECODE LABELS?? (part 2)

I'm not sure if I understood what you really want. But if you want to display the Count of each Status, you can create a ListBox and check the 'Show Frequency' option in the General tab. I've attached a sample qvw with this setting.

Hope this is what your need.

Regards,

Fernando

Not applicable

HOW TO RECODE LABELS?? (part 2)

Hey Fernando!! Thanks for the sample attachment!!

Well, the problem is that, that one only searches the one with CANNOT FIND, and then puts the frequency as 1.

like i asked previously, there are say 6 boxes with CANNOT FIND, so the frequency must be 6!

But what you gave me is like, since everything is listed as CANNOT FIND, the frequency is just 1, you understand?

Not applicable

HOW TO RECODE LABELS?? (part 2)

Hi Fernando!

It's alright! i found a simple solution to that Count problem! Its not really what i wanted, but it will work.

All we have to do is,

1) Click the Properties of the Chart,

2) Go to the Expression which we are dealing with, in this case, MANUF_NO.

3)Under Total Mode, click the (Sum of Rows) box, and change the sum to TOTAL COUNT.

4)Click OK, when you come to the main screen, under the MANUF_NO column, the frequency number will be displayed!

Cheers!

Thanks for your help! [=