QV: Resue expressions in a chart definition

It's often useful to avoid repeating lengthy expressions. Here's one technique for reusing expressions.


Consider the chart below.  The Expression for the column labeled "Net" is:
  =sum(Quantity * Price) * (1-Discount)

 

Let's add another column for "Commission", defined  as 10% of Net. Instead of repeating the Net calculation, use the expression:

  =Net * .1


Qlikview allows referencing the value of another column in the same chart by name. The name is the value assigned to the column label. "Net" in this case is not a Field. It is a symbolic reference to an expression. It may be used in other expressions in the same chart, but not in places where a Field name is expected.

  =Net / 2          Allowed
  =above(Net)   Allowed
  =Sum(Net)        Not allowed

 

posted on 2014-02-12 22:08  ITPCBI  阅读(267)  评论(0编辑  收藏  举报