Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Create table with all possible values of a variable

Hi guys, I'm new to QlikView and I've encountered some difficulties. I have my tables and I have a variable (let's call in var3) that gets updated based on other 2 variables(var1 and var2). These two, var1 and var2 (these variables are numbers), get their values after two selections from two fields(let  and var3 is simply the multiplication of these two variables ( var1 and var2).

What I am trying to do is to create a list, a table, whatever, with all the possible values for var3. (this actually means that I need some kind of script that would take all the possibilities of choices from f1 and f2 and calculate var3 and then save all the possible values of var3 in a table/list/whatever.

Thank you, I hope I explained myself well.

PS: I have the free version, so it would be great if you could explain me by writing for I cannot open files created by other users.

2 Replies

Re: Create table with all possible values of a variable

tmp:

load distinct f1 resident f1_source_table;

join (tmp)

load distinct f2 resident f2_source_table;

result:

load f1*f2 as f3

resident tmp;

drop table tmp;


talk is cheap, supply exceeds demand

Re: Create table with all possible values of a variable

Hi Adrian,

one demo application that might help:

table1:

LOAD RowNo() as ID1,

    RowNo() as num1

AutoGenerate 20;

table2:

LOAD RowNo() as ID2,

    RowNo() as num2

AutoGenerate 20;

NoConcatenate

table3:

LOAD Distinct * Resident table1;

Join (table3)

LOAD Distinct * Resident table2;

Left Join (table3)

LOAD Distinct

  num1,

  num2,

  num1*num2 as num3,

  RowNo() as ID3

Resident table3;

DROP Fields num1, num2 From table3;

QlikCommunity_Thread_125027_Pic3.png

QlikCommunity_Thread_125027_Pic1.png

QlikCommunity_Thread_125027_Pic2.png

regards

Marco

Community Browser