Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

riccardozenere
Contributor III

Set analysis, straight tables and expressions

Hi everyone,

I have three straight tables with the same expressions. The tables are different between them because on everyone I used a different parameter in the single expressions (so table1 will have parameter vParameter1, table2 will have vParameter2, table3 will have vParameter3).

Currently I set the parameters into the set analysis manually, but I would like to add another expression in the tables (e.g. let's call it "Parameter") where I set only the relative parameter for that table (vParameter1/vParameter2/vParameter3) and then in the expression below I call only the said column. This would be really helpful to me in order to maintain the code

It works when I call the expression "Parameter" normally, but I'm unable to do it into the set analysis... It there a way to do this?

1 Solution

Accepted Solutions

Re: Set analysis, straight tables and expressions

Hi,

instead of defining the vParameter variable in an additional "Parameter" expression, you could use parameterized variables as your expressions like:

SET vSold = Sum({$<articolParameter={'$1'}>}articolPrice);

QlikCommunity_Thread_186268_Pic2.JPG

or

LET vSold2 = 'Sum({$<articolParameter={'''&Chr(36)&'($1)''}>}articolPrice)';

QlikCommunity_Thread_186268_Pic1.JPG

hope this helps

regards

Marco

5 Replies

Re: Set analysis, straight tables and expressions

‌please post sample application.

thanks

regards

Marco

riccardozenere
Contributor III

Re: Set analysis, straight tables and expressions

Hi Marco,

hope this helps even if it's a basic example. In my real environment table1, table2 and table3 have many more expressions.

Where I would like to arrive is similar to tableX (which currently doesn't work, of course): defining a new expression (labeled "Parameter" in tableX) I would like to be able to call this expression within the set analysis into the same straight table in order to achieve that the code in the three tables is always the same, except for the value of that single expression "Parameter" (so, ideally, I can set variables for the expressions and manage only once the code instead of three times like now).

Hope this is clear (and possible too),

Riccardo

Re: Set analysis, straight tables and expressions

Hi,

instead of defining the vParameter variable in an additional "Parameter" expression, you could use parameterized variables as your expressions like:

SET vSold = Sum({$<articolParameter={'$1'}>}articolPrice);

QlikCommunity_Thread_186268_Pic2.JPG

or

LET vSold2 = 'Sum({$<articolParameter={'''&Chr(36)&'($1)''}>}articolPrice)';

QlikCommunity_Thread_186268_Pic1.JPG

hope this helps

regards

Marco

riccardozenere
Contributor III

Re: Set analysis, straight tables and expressions

Nice solution, didn't thought to do it this way but is much better than it is right now... Thank you!

Re: Set analysis, straight tables and expressions

‌you're welcome.

Glad I could help.

regards

Marco

Community Browser