Qlik Community

Ask a Question

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Welcome to our newly redesigned Qlik Community! Read our blog to learn about all the new updates: READ BLOG and REPORTED ISSUES
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

vLookup as expression (within unconnected tables)

Hi Community,

i'm facing with a "big problem". I' can't sleep

I want to get some values in the main table (similar to Excel:vlookup) from another table using an expression.

I can't get the desired values using  Scripts(datamodel) because the 2 tables (data & matrix, see attached .qvw) are not directly connected:the  "Key Fields" in table1 are calculated after running script, based on expressions:

The Expressions (i.e PARETO EFFICIENCY)  are something like that:

=if

(rangesum(above(total sum(QTY),0,Rowno())) /sum(total <SubCategory> QTY)>0.95,'C',

if

(rangesum(above(total sum(QTY),0,Rowno()))/sum(total <SubCategory> QTY)>0.80,'B',

'A'))

GOAL:

My goal is to link  the right values of column PRICE_LEVEL#01, PRICE_LEVEL#02,PRICE_LEVEL#03 (table2)  to the main table 1.

PS: I would like to avoid IF statement , because i have 48 combinations of values.

Please, i need help.

Thanks to all

6 Replies
Creator III
Creator III

Check this link: https://community.qlik.com/message/1005112#1005112

May help you. I think, lookup function will help you.

MVP
MVP

Not sure if your sample shows what you describe above, the two tables are linked in the data model, and there is already a classification field present in the table.

Not applicable

i've now loaded the right qvw.

Not applicable

You're right Swuehl....

(i've now loaded the right qvw.)

Thank you.

Creator
Creator

Hi Mark,

I really didn't understand your problem. Let's think simpler ways. Can you please tell us what your input data set look like and what you want as an output ??? If you understand your requirement then some dummy entries you can provide. Cheers...

Regards,

Joy

MVP
MVP

You probably request that your ITEM field values in the chart should be sorted by your expression or is this done somehow in the script?