Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
pavanthota
Creator
Creator

Develop the code

Hi ,

I am new to the Qlikview i want to Populate the date with some conditions. Can anyone assist to develop the code

I have two tables

Table1:

A     B      C      D

1      2      9    

3      4     10

5      6     11     25

7      8     12   

    

Table 2:

A     B     C     H

11     12   15     21

1      2     9     22

3     4     10     23

5     6     11     24

7     8     12     27

Here is the data i want output as the table 1

Conditions:

I want to populated the "H" field data into table 1 "D" field where D is null values and i want to satisfy the below conditions also

Table1.A=Table2.A

Table1.B=Table2.B

Table1.C=Table2.C

    

     Can you please any one help on this

1 Solution

Accepted Solutions
clisboa_noesis
Partner - Creator
Partner - Creator

Pavan,

That's what alt is for, if D has value then it's that value that is returned, if it's null then what gets returned is the applymap.

Regards,

Carlos

View solution in original post

5 Replies
clisboa_noesis
Partner - Creator
Partner - Creator

Hi Pavan,

The easiest way to me seems to be the ApplyMap.

First you need to load table2 has an mapping:

Table2:

Mapping

LOAD

     A & B & C as Key,

     H as D

FROM ...

And then when you load table1 you can simply:

Table1:

LOAD

     A,

     B,

     C,

     alt(D,ApplyMap('Table2', A&B&C, null() )) as D

From ...

alt returns the first non null value, so if D is null it will return the applymap for that record.

Hope this helps

Regards

Carlos

pavanthota
Creator
Creator
Author

Thanks carlos for ur help

But i dont want to update "D" field if it has value. can you help me on that

clisboa_noesis
Partner - Creator
Partner - Creator

Pavan,

That's what alt is for, if D has value then it's that value that is returned, if it's null then what gets returned is the applymap.

Regards,

Carlos

SunilChauhan
Champion
Champion

see the attched file

hope this helps

Sunil Chauhan
pavanthota
Creator
Creator
Author

Hi Carlos

Can you explain me how mapping internaly works and can you give brief documentation for that

Thanks

Pavan