Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
Not applicable

Sum(total <dim1 >[Expression1]) in Pivot table is not working?

Dear Community,

I would like to use expression in another expression in pivot table with Sum(total <dim1 >[Expression]) condition,

but it is not working, anyone has idea?

Attached herewith the sample (where it is not a real case which is much more complicated)

The reason why I need to apply:

Expression1 is actually an input field, which is one of the column in table.

Client can change the value for that input column, and any change in this column will reflect to Expression2.

where Expression2 = Sum(total <dim1 >[Expression1])

There are 3 conditions to calculate Expression2 based on expression1 value,

Example:

if(expression1<100 ,  expression1*0.01,

     if(expression1=100, expression1*0.02,

          if(expression1>100, expression1*0.03, 0)))

Hope someone could help!

Thanks,

Chanel

6 Replies
Highlighted
MVP
MVP

Re: Expression in Pivot table (used by another Expression)

What logic you want to apply here?

Update :

Try as Below

SUM(IF(Aggr(SUM(TOTAL <Month> Sales),Salesman)>=15000,Sales))

Highlighted
MVP & Luminary
MVP & Luminary

Re: Expression in Pivot table (used by another Expression)

Hi,

Try like this

if( [Total Sales] >= 15000, sum(Total <Month> Sales))

Regards,

Jagan.

Highlighted
Valued Contributor II

Re: Expression in Pivot table (used by another Expression)

try this expression for the second one.

If (ColumnNo(1) >= 15000,  OptionTrue, OptionFalse)

Changing Options for you apropiate formula

Joaquín

Highlighted
Not applicable

Re: Expression in Pivot table (used by another Expression)

Dear all,

The sample is just the example, my expression is far more complicated than this, my problem is

how can i call another expression in the same table,

if i have that condition

= sum(total <abc>

     if([expression1] = 'blabla', 'Sales'))

Is it not possible to use expression in sum(total ...) ?

Thanks,

Chanel

Highlighted
MVP
MVP

Re: Expression in Pivot table (used by another Expression)

What is your LOGIC? can you please elaborate little more that what you want to achieve?

Thanks

Highlighted
Not applicable

Re: Expression in Pivot table (used by another Expression)

Well, the expression1 is actually an input field, which is one of the column in table.

Client can change the value for that input column, and any change in this column will reflect to expression2.

So expression2 has to call expression1, then based on expression1 value,

there are 3 conditions:

Example:

if(expression1<100 ,  expression1*0.01,

     if(expression1=100, expression1*0.02,

          if(expression1>100, expression1*0.03, 0)))

At last, we would need to get the total of this 3 conditions, that's why i need to use sum(total <> if(blabla....))

Thanks,

Chanel