Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
galileumax
Contributor II
Contributor II

Dynamic mapping

Hello to all,

it's possible to use mapping dynamically ?

From a table made like this :

  

NamefromtoGroup
pippo01/01/201831/05/2018Pink
pippo01/06/201831/08/2018Red
pippo01/09/201831/10/2018Yellow
pippo01/11/201830/11/2018Green
pippo01/12/201831/12/2018White
pluto01/01/201831/05/2018Red
pluto01/06/201831/08/2018Pink
pluto01/09/201831/10/2018Green
pluto01/11/201830/11/2018Yellow
pluto01/12/201831/12/2018White
paperino01/01/201831/05/2018White
paperino01/06/201831/08/2018Pink
paperino01/09/201831/10/2018Yellow
paperino01/11/201830/11/2018Green
paperino01/12/201831/12/2018Red

I would like to have a table like that:

   

IDNameDatePzGroup
1pippo13/05/201867Pink
2pluto14/10/201853Green
3paperino02/02/201822White
4pippo01/06/201866Red
5pluto24/12/201832White
6paperino19/09/20188Yellow
7pippo29/04/201877Pink
8pluto27/11/201844Yellow
9paperino08/12/201833Red
10pippo12/05/201822Pink
11pluto15/09/201833Green
12paperino08/03/201855White
13pippo09/11/201811Green
14pluto23/08/201811Pink
15paperino31/03/201833White
16pippo14/01/201899Pink
17pluto02/01/201876Red
18paperino07/09/201856Yellow
19pippo18/06/201854Red
20pluto15/03/201812Red
21paperino23/09/201810Yellow

Assign the group in relation to the date range of the first table

Someone could help me.

Thanks in advance

1 Solution

Accepted Solutions
galileumax
Contributor II
Contributor II
Author

Great!! It's perfect Thank you so much

View solution in original post

3 Replies
felipedl
Partner - Specialist III
Partner - Specialist III

Hi Massimo,

You can use intervalmatch with more than one key (Date and Name fields) like so:

map:

load * Inline

[

Name,from,to,Group

pippo,01/01/2018,31/05/2018,Pink

pippo,01/06/2018,31/08/2018,Red

pippo,01/09/2018,31/10/2018,Yellow

pippo,01/11/2018,30/11/2018,Green

pippo,01/12/2018,31/12/2018,White

pluto,01/01/2018,31/05/2018,Red

pluto,01/06/2018,31/08/2018,Pink

pluto,01/09/2018,31/10/2018,Green

pluto,01/11/2018,30/11/2018,Yellow

pluto,01/12/2018,31/12/2018,White

paperino,01/01/2018,31/05/2018,White

paperino,01/06/2018,31/08/2018,Pink

paperino,01/09/2018,31/10/2018,Yellow

paperino,01/11/2018,30/11/2018,Green

paperino,01/12/2018,31/12/2018,Red

];

Data:

load * Inline

[

ID,Name,Date,Pz

1,pippo,13/05/2018,67

2,pluto,14/10/2018,53

3,paperino,02/02/2018,22

4,pippo,01/06/2018,66

5,pluto,24/12/2018,32

6,paperino,19/09/2018,8

7,pippo,29/04/2018,77

8,pluto,27/11/2018,44

9,paperino,08/12/2018,33

10,pippo,12/05/2018,22

11,pluto,15/09/2018,33

12,paperino,08/03/2018,55

13,pippo,09/11/2018,11

14,pluto,23/08/2018,11

15,paperino,31/03/2018,33

16,pippo,14/01/2018,99

17,pluto,02/01/2018,76

18,paperino,07/09/2018,56

19,pippo,18/06/2018,54

20,pluto,15/03/2018,12

21,paperino,23/09/2018,10

];

left join (Data)

IntervalMatch(Date,Name)

Load

from,

to,

Name

Resident map;

left join (Data)

Load

Name,

from,

to,

Group

Resident map;

drop table map;

drop fields from,to from Data;

This will get the result:

sample.png

galileumax
Contributor II
Contributor II
Author

Great!! It's perfect Thank you so much

felipedl
Partner - Specialist III
Partner - Specialist III

No problem.

Can you mark the post as answered to help other too?

Thanks.