Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
omid5ive
Creator II
Creator II

show all value from both table

hi

i have two table like below:

ProductstateCode
a1
b2
c3
a2

and

statecodevalue
110
220
330

i want to show value of each product in all state like below:

productstatecodevalue
a110
a220
a30
b10
b220
b30
c10
c20
c330

what should i do?

4 Replies
Chanty4u
MVP
MVP

Hi

is this ?

A:

load * Inline

[

Product    ,stateCode

a,    1

a,    2

b,    2

c,    3

];

right Join(A)

B:

LOAD * Inline

[

statecode    ,value

1    ,10

2,    20

3,    30

];

re.PNG

Anonymous
Not applicable

May be a worst possible way to do it..

B:

Load *,Product&'|'&stateCode as Key Inline [

Product,stateCode

a,1

b,2

c,3

a,2]

;

A:

Load distinct Product as p1 Resident B;

left join

Load * inline [

statecode,value

1,10

2,20

3,30];

C:

Load *,p1&'|'&statecode as Key Resident A;

drop table A;

left join (C)

load * Resident B;

😧

Load p1 as Product,statecode,if(IsNull(stateCode),0,value) as value Resident C Order by p1;

drop table B,C;

qlikview979
Specialist
Specialist

May be this

A:

load * Inline

[

Product    ,stateCode

a,    1

a,    2

b,    2

c,    3

];

Right Join(A)

B:

LOAD * Inline

[

statecode    ,value

1    ,10

2,    20

3,    30

];

Untitled.png

Kushal_Chawda

see this

MapValue:

mapping LOAD

                     statecode,

                     Value

FROM Table2;

Data:

LOAD Product,

         statecode,

         ApplyMap('MapValue',statecode,Null()) as Value

FROM Table1;

New:

LOAD Distinct Product

Resident Data;

Left Join (New)

LOAD distinct statecode

FROM Table2;

Left Join (New)

LOAD Product,

     statecode,

     Value

Resident Data;

DROP Table Data;

Final:

NoConcatenate

LOAD Product,

     statecode,

     alt(Value,0) as Value

Resident New;

DROP Table New;