Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

micheledenardi
Valued Contributor

Applymap with dynamic table name

Hi guys,

is there a way to use a field (in my case "Dim3" ) as teble name during an applymap() ?

I know that the table name must be enclosed by single quote but there is anybody which know any trick ?

I want to avoid join or concatenate solutions...

Dim1Dim2Dim3Value1
AAAMappingTable11
BBBMappingTable22
CCCMappingTable33
DDDMappingTable44
EEEMappingTable55
FFFMappingTable66
Tags (1)
5 Replies
MVP
MVP

Re: Applymap with dynamic table name

Do you have a sample where we can test this out?

jmvilaplanap
Valued Contributor

Re: Applymap with dynamic table name

Hi

You can define the table name as a variable with LET LET and SET

But I need a sample to see exactly what are you thinking to do.

Regards

micheledenardi
Valued Contributor

Re: Applymap with dynamic table name

I've attached the sample data

MVP
MVP

Re: Applymap with dynamic table name

I guess not what you would like, but your best bet is this

FactTable:

LOAD Dim1,

    Dim2,

    Dim3,

    Value1,

    Pick(KeepChar(Dim2, '0123456789'),

    ApplyMap('MappingTable1', Dim2),

    ApplyMap('MappingTable2', Dim2),

    ApplyMap('MappingTable3', Dim2),

    ApplyMap('MappingTable4', Dim2),

    ApplyMap('MappingTable5', Dim2),

    ApplyMap('MappingTable6', Dim2)) as MappedValue2

FROM

[..\..\Downloads\SampleData.xlsx]

(ooxml, embedded labels, table is Foglio1);

micheledenardi
Valued Contributor

Re: Applymap with dynamic table name

Hi Sunny,

thanks for you solution but i want to avoid fixed table name.

I have found this thread Qlik Tips: Dynamic ApplyMap but this approach do not work for me... i've tried in both qlikview and qliksense but when the script execution arrive at the applymap qlik is freezing.

Community Browser