Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Korto2024
Contributor III
Contributor III

ApplyMap with composit column

Hi ,

i have this script 

Achat:

load

ID,

date_commande

;

load

id_ligne,

N_Commande,

date_commande,

id_ligne&N_Commande as ID,

from source.qvd

 

paiement:

Load 

id_paiement,

id_ligne as ligne,

N_Commande as cmd,

Applymap('Achat',id_ligne&N_commande,'xx') as date_cmd

from source.qvd 

 

i want to get the date_cmmande of each id_ligne concatenate with N_commade from the table Achat

is a correct code or not , i cant get this infomation

thanks

Labels (3)
2 Solutions

Accepted Solutions
LRuCelver
Partner - Creator III
Partner - Creator III

After fixing all the smaller mistakes the syntax highlighter was throwing with me and others that could or would have lead to errors, as well as cleaning things up a bit I'm left with this:

Achat:
Mapping Load
    ID,
    date_commande;
Load
    id_ligne,
    N_Commande,
    date_commande,
    id_ligne & '|' & N_Commande as ID
From "source.qvd" (qvd);

paiement:
Load 
    id_paiement,
    id_ligne as ligne,
    N_Commande as cmd,
    Applymap('Achat', id_ligne & '|' & N_commande, 'xx') as date_cmd
From "source.qvd" (qvd);

 

I can't test it since I don't have the data, but it should work.

However you are creating the map from the exact same fields you are then applying it to. In other words: The map will always be able to be applied. You could've used a join or even easier: load the data directly from the file:

paiement:
Load 
    id_paiement,
    id_ligne as ligne,
    N_Commande as cmd,
    date_commande as date_cmd
From "source.qvd" (qvd);

View solution in original post

Korto2024
Contributor III
Contributor III
Author

 that work parfectly

Thanks

View solution in original post

2 Replies
LRuCelver
Partner - Creator III
Partner - Creator III

After fixing all the smaller mistakes the syntax highlighter was throwing with me and others that could or would have lead to errors, as well as cleaning things up a bit I'm left with this:

Achat:
Mapping Load
    ID,
    date_commande;
Load
    id_ligne,
    N_Commande,
    date_commande,
    id_ligne & '|' & N_Commande as ID
From "source.qvd" (qvd);

paiement:
Load 
    id_paiement,
    id_ligne as ligne,
    N_Commande as cmd,
    Applymap('Achat', id_ligne & '|' & N_commande, 'xx') as date_cmd
From "source.qvd" (qvd);

 

I can't test it since I don't have the data, but it should work.

However you are creating the map from the exact same fields you are then applying it to. In other words: The map will always be able to be applied. You could've used a join or even easier: load the data directly from the file:

paiement:
Load 
    id_paiement,
    id_ligne as ligne,
    N_Commande as cmd,
    date_commande as date_cmd
From "source.qvd" (qvd);
Korto2024
Contributor III
Contributor III
Author

 that work parfectly

Thanks