Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Highlighted
Not applicable

How to replace all fileds with their corresponding keys

I have these two tables:

Table1:

1.png

Table2:

2.png

I want to replace all of the YearEvents and YearEventKey_Grouping with their corresponding key... so for example replace all 2009 WTS with a 1. all 2011 WTS with a 2... etc.

Thanks!

1 Solution

Accepted Solutions
bwisenosimenkg
Valued Contributor

Re: How to replace all fileds with their corresponding keys

I'm not sure I understand your problem exactly, but if you want to make the YearEventKey_Grouping go from

2009 Submission-2010 Submission to 12-13, then this is how you can do it.

YearEventIDMap:

mapping load

YearEvent,

id

From Table2; //If this table is in memory, then you should use Resident Table2; in stead of From.

Table1:

load

mapsubstring('YearEventIDMap',YearEventKey_Grouping) as YearEventKey_Grouping,

Volume,

ProductA,

ProductB

From Table1; //need to replace this line with the source for table 1.

Hope this helps


Regards
SKG

2 Replies
bwisenosimenkg
Valued Contributor

Re: How to replace all fileds with their corresponding keys

I'm not sure I understand your problem exactly, but if you want to make the YearEventKey_Grouping go from

2009 Submission-2010 Submission to 12-13, then this is how you can do it.

YearEventIDMap:

mapping load

YearEvent,

id

From Table2; //If this table is in memory, then you should use Resident Table2; in stead of From.

Table1:

load

mapsubstring('YearEventIDMap',YearEventKey_Grouping) as YearEventKey_Grouping,

Volume,

ProductA,

ProductB

From Table1; //need to replace this line with the source for table 1.

Hope this helps


Regards
SKG

Not applicable

Re: How to replace all fileds with their corresponding keys

Perfect. Thank you