Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

how to fetch particular datavalues if table is as follows

Hello frns,

Again having problem, please help.

I have three tables as:

Table1                                   Table2                              Table3

pk_Col1     Col2                  pk_Col3     Col4                fk_Col5    fk_Col6  col7

A1     B1                              C1     D1                         A2          C3          E1

A2     B2                              C2     D1                         A4          C1          E2

A3     B3                              C3     D3                         A3          C4         E3

A4     B4                              C4     D3                         A1          C2         E4

SO THE QUERY IS :

i want to access the data from table3 and col7 for the corresponding value of B3 AND D3

means i want to fetch data E3 from table3 what expression i need to use..

please reply as early as possible..

Thanks..

13 Replies
MVP & Luminary
MVP & Luminary

Re: how to fetch particular datavalues if table is as follows

Rename fields in the three tables so Qlikview can associate the tables correctly. For example:

Table1:

Load pk_Col1 as Key1, Col2

from ...table1source...;

Table2:

Load pl_Col3 as Key2, Col4

from ...table2source...;

Table3:

load fk_Col5 as Key1, fk_Col6 as Key2, Col7

from ...table3source...;


talk is cheap, supply exceeds demand
Not applicable

Re: how to fetch particular datavalues if table is as follows

i did this and able to make relationship between table but my task is to make a straight table chart using the same query.

please help me

MVP & Luminary
MVP & Luminary

Re: how to fetch particular datavalues if table is as follows

I think you should use a table box, but fine use a straight table if you want. Create a straight table with col7 as dimension and as expressions Col2 and Col4. Then select value E3 in the first column of the straight table by clicking on E3. If it doesn't work you should have used a table box with Col2, Col4 and Col6 as fields.


talk is cheap, supply exceeds demand
saumyashah90
Valued Contributor

Re: how to fetch particular datavalues if table is as follows

TableO:

Load

fk_Col5 as pk_Col1,

fk_Col6 as pk_Col3,

col7 resident Table3;

left join(TableO)

load * resident Table1;

Left join(TableO)

Load * resident Table2;

Drop tables Table1,Table2;

or else you have to hard code it

Not applicable

Re: how to fetch particular datavalues if table is as follows

but i don't want to show all the col values in the straight table chart or the table box...

I want to show only some particular value

saumyashah90
Valued Contributor

Re: how to fetch particular datavalues if table is as follows

Hard Code:

if(pk_Col1='A3' and pk_Col3='C3',E3)

Not applicable

Re: how to fetch particular datavalues if table is as follows

and if i want to make it as an expression(general expession) for the chart where like E3 i want to select two more values based on corresponding condition..like now i want to show only E1, E3 then, please ans me by considering that these tables are having larger values..

saumyashah90
Valued Contributor

Re: how to fetch particular datavalues if table is as follows

1)You cannot make an general expression with the given  tables and its field names.

2)Option will be  if you change column names in Table3 to same column names as in Table1 and Table2 we can think over it without making it a single table

MVP & Luminary
MVP & Luminary

Re: how to fetch particular datavalues if table is as follows

Then select that value (or values if you need show the result for more than one value) in the table box of straight table. Or add a listbox for Col6 and select the values in the listbox.


talk is cheap, supply exceeds demand