Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Expressions loaded in inline table

Hello everyone,

I am creating a report where I am using the same sales expressions in many different tables.

I am loading an inline table with those expressions written in it as following:

What I don't know is how to actually proceed after that, in order to use those expressions in my pivots.

I have tested them separately, for example if I write in my pivot the expression

=SUM({$<MTD_Flag={1}>} Unit_Sales)

it gives the correct results.

What I want to do is retrieve the expression just by using the Pivot_Expr field name, so by switching between the Units and Net Sales or the different periods, I can automatically have the right results. Another reason for this is that those expressions are used in many places in my layout tables, so I would like to have them all in one place, for better future support.

I have tried writing as an expression in my pivot the $(=Pivot_Expr) but it doesn't give any results.

Could someone please help me with this?

Thanks in advance for your time

Best Regards,

Maria.

1 Solution

Accepted Solutions
jsaradhi
Valued Contributor

Re: Expressions loaded in inline table

i do this quite a bit for the same reasons you mentioned and also ease of maintenance...do you have a list box for the Analysis_Type and Period_Type? Unless there is only one possible value for Pivot_Expr, the chart will not output any results...see attached for an example (clear selections for F2 and see what happens).

5 Replies

Re: Expressions loaded in inline table

The "expression" are becoming part of your data not a part of calculation so you will not be able to use them this way.

If you do not want them to rewrite many times you can create a variable and then use it in your PT

jsaradhi
Valued Contributor

Re: Expressions loaded in inline table

i do this quite a bit for the same reasons you mentioned and also ease of maintenance...do you have a list box for the Analysis_Type and Period_Type? Unless there is only one possible value for Pivot_Expr, the chart will not output any results...see attached for an example (clear selections for F2 and see what happens).

Not applicable

Re: Expressions loaded in inline table

Hi,

don't use apostrophs in the inline statment.

it should look like this:

LOAD * INLINE [
Analysis Type, Period Type, Pivot_Expr
Units, Month To Date, =SUM({$<MTD_Flag={1}>} Unit_Sales)

...

Then the expression you used

$(=Pivot_Expr)

will work. But only one value in fields Analysis Type and Period Type can be chosen.

Re: Expressions loaded in inline table

Are you sure?

jsaradhi
Valued Contributor

Re: Expressions loaded in inline table

you don't need "=" sign in the expression definition in your table. if you do use it, then you wouldn't need "=" sign in the expression in the chart. you only need it once. may be the attachment in my post above will help.

Community Browser