Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Expression Help3

Hi All,

I'm look for a vlookup function in Qlik.. Column E is what I'm look for. Below is what I have in Excel.

=IFERROR(((VLOOKUP(B2,$A$2:$E$13,5,FALSE)*C2)/100),(C2*E2)/100)

   

ABCD E
CompanySub CompanyMultiplier

Original Amount

Vlookup Amount
OrangeABC5.0000      1,000,000                             5,000
BananaABC0.5000      1,000,000                                500
AppleABC3.5000      1,000,000                             3,500
PineappleABC1.2500      1,000,000                             1,250
XYZABC85.0000      1,000,000                          85,000
SinABC4.7500      1,000,000                             4,750
AlphaOrange100.0000      1,000,000                             5,000
DEFBanana100.0000      1,000,000                                500
MNOApple100.0000      1,000,000                             3,500
PIEPineapple100.0000      1,000,000                             1,250
CherryXYZ100.0000      1,000,000                          85,000
StoneCherry100.0000      1,000,000                          85,000

   

Many Thanks,

Frank

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

HI,

Try like this

CompanyMap:

MAPPING LOAD DISTINCT

Company,

[Sub Company]

FROM

[test (2).xlsx]

(ooxml, embedded labels, header is 1 lines, table is Sheet1);

Data:

LOAD

*,

Multiplier * [Total Value] AS OverallValue

WHERE IsCompany = 0;

LOAD Company,

     [Sub Company],

     Multiplier,

     [Total Value],

     ApplyMap('CompanyMap', [Sub Company], '0') AS IsCompany

FROM

[test (2).xlsx]

(ooxml, embedded labels, header is 1 lines, table is Sheet1);

OverallValueMapping:

MAPPING LOAD

Company,

OverallValue

RESIDENT Data

WHERE 1 = 1;

CompanySubcompanyMapping:

MAPPING LOAD DISTINCT

Company,

[Sub Company]

FROM

[test (2).xlsx]

(ooxml, embedded labels, header is 1 lines, table is Sheet1);

Concatenate(Data)

LOAD

*,

If(ApplyMap('OverallValueMapping', [Sub Company], 'NA') <> 'NA',  ApplyMap('OverallValueMapping', [Sub Company], 'NA'), 

  ApplyMap('OverallValueMapping', Applymap('CompanySubcompanyMapping', [Sub Company]), 'NA'))AS OverallValue

WHERE IsCompany <> 0;

LOAD Company,

     [Sub Company],

     Multiplier,

     [Total Value],

     ApplyMap('CompanyMap', [Sub Company], '0') AS IsCompany

FROM

[test (2).xlsx]

(ooxml, embedded labels, header is 1 lines, table is Sheet1);

Regards,

jagan.

View solution in original post

7 Replies
jagan
Luminary Alumni
Luminary Alumni

HI,

Attach sample data in Excel.


Regards,

Jagan.

robert_mika
Master III
Master III

Anonymous
Not applicable
Author

Hi Jagan,

See attached.

jagan
Luminary Alumni
Luminary Alumni

HI,

Try like this

CompanyMap:

MAPPING LOAD DISTINCT

Company,

[Sub Company]

FROM

[test (2).xlsx]

(ooxml, embedded labels, header is 1 lines, table is Sheet1);

Data:

LOAD

*,

Multiplier * [Total Value] AS OverallValue

WHERE IsCompany = 0;

LOAD Company,

     [Sub Company],

     Multiplier,

     [Total Value],

     ApplyMap('CompanyMap', [Sub Company], '0') AS IsCompany

FROM

[test (2).xlsx]

(ooxml, embedded labels, header is 1 lines, table is Sheet1);

OverallValueMapping:

MAPPING LOAD

Company,

OverallValue

RESIDENT Data

WHERE 1 = 1;

CompanySubcompanyMapping:

MAPPING LOAD DISTINCT

Company,

[Sub Company]

FROM

[test (2).xlsx]

(ooxml, embedded labels, header is 1 lines, table is Sheet1);

Concatenate(Data)

LOAD

*,

If(ApplyMap('OverallValueMapping', [Sub Company], 'NA') <> 'NA',  ApplyMap('OverallValueMapping', [Sub Company], 'NA'), 

  ApplyMap('OverallValueMapping', Applymap('CompanySubcompanyMapping', [Sub Company]), 'NA'))AS OverallValue

WHERE IsCompany <> 0;

LOAD Company,

     [Sub Company],

     Multiplier,

     [Total Value],

     ApplyMap('CompanyMap', [Sub Company], '0') AS IsCompany

FROM

[test (2).xlsx]

(ooxml, embedded labels, header is 1 lines, table is Sheet1);

Regards,

jagan.

Anonymous
Not applicable
Author

Thanks  Jagan. Will test it out later. This is new and advance  for me.

Anonymous
Not applicable
Author

Hi Jagan,

I need your help again. Some of the "Overallvalue" are not correct. I'm not sure how two Sub Company ="NA".  If you check Sub Company - Kabob II and Cherry, the 'OverallValue" doesn't seems right.  I have attached my sample Excel and QVW files.

Many Thanks,

Frank

Anonymous
Not applicable
Author

Jagan,

Were you able to help? I'm having issues with the "NA" and dupes not showing up.