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.
Employee
Employee

Binary Load x Mapping Table

I would like to have a mapping table coming from a datamart qvw loaded through binary load.

Unfortunately, a table created like below is not loaded when the binary is executed

Prefixos:

mapping load * ;

sql SELECT DISTINCT

  PREFIXO,

  isnull(b.OPERADORA_TRATADA,PRESTADORA) as PRESTADORA

FROM TB_PREFIXOS a

left join TB_OPERADORAS b on a.PRESTADORA = b.OPERADORA;

I´m using a workaround like this that is not so optimized as I would like

Datamart.qvw

Prefixos:

sql SELECT DISTINCT

  PREFIXO,

  isnull(b.OPERADORA_TRATADA,PRESTADORA) as PRESTADORA

FROM TB_PREFIXOS a

left join TB_OPERADORAS b on a.PRESTADORA = b.OPERADORA;

Dashboard.qvw

Binary [Datamart.qvw];

MapaPrefixos:

Mapping LOAD * Resident Prefixos;

Drop Table Prefixos;

Any ideas how could I improve it?

1 Solution

Accepted Solutions

Re: Binary Load x Mapping Table

I think the problem here is that the mapping table won't exist after the Datamart.qvw runs through and if it doesn't exits, you would not be able to do a applymap on it. I think what you have is one of the option, the other being bringing the mapping load table directly in your new qvw after saving it into a qvd.

Prefixos:

mapping

LOAD DISTINCT

  PREFIXO,

  isnull(b.OPERADORA_TRATADA,PRESTADORA) as PRESTADORA

FROM TB_PREFIXOS.qvd (qvd);

4 Replies

Re: Binary Load x Mapping Table

I think the problem here is that the mapping table won't exist after the Datamart.qvw runs through and if it doesn't exits, you would not be able to do a applymap on it. I think what you have is one of the option, the other being bringing the mapping load table directly in your new qvw after saving it into a qvd.

Prefixos:

mapping

LOAD DISTINCT

  PREFIXO,

  isnull(b.OPERADORA_TRATADA,PRESTADORA) as PRESTADORA

FROM TB_PREFIXOS.qvd (qvd);

Re: Binary Load x Mapping Table

Sunny is right. The lifetime of a Mapping table extends to the end of the current script run. Not a second longer.. Mapping tables do not survive the current cycle as they aren't really meant to be more than temporary but extremeley fast translation tables. Ad hoc solutions ("hacks") so to say. A mapping table is also - and by design - never a part of a data mart.

If you need a mapping table in different places, recreate it in those places. It makes no use to load it in one run and use it only in the next run. Although you may have sensible use cases.

Re: Binary Load x Mapping Table

Hi Clever,

maybe using some loop to identify tables with names like 'Mapa*' and mapping loading them resident, droping the source table afterwards.

You just would need to purge the mapping prefix in your Datamart.qvw and could include such a code snippet as some sort of standard transformation in your target qvws.

hope this helps

regards

Marco

Employee
Employee

Re: Binary Load x Mapping Table

Thank you all.

As I was thinking a mapping table does not survive the end of script;

I was hoping there´s a "hack", but it seems there´s not

Going to test what is faster:

  • Resident load of a table from datamart
  • Loading a qvd (unfortunately a mapping load seems to discard a optimized load too )
Community Browser