Author Topic: How to write formula that is dependent of current measure? If command?  (Read 1642 times)

Offline abcuser

  • Full Member
  • ***
  • Posts: 19
  • Forum Citizenship: +0/-0
Hi,
in Cognos BI v8.4.1 Report Studio in Crosstab I would like to write formula that accesses TM1 v9.5 cube.

I have two products "A" and "B". I have a price measure for this member and quantity sold for this products. Now I need to calculate what is sum of quantity for this two products and what is average price sold for this two products.

I have a problem with "sum of A and B" formula which is dependent of current measure. I most probably must write some kind of IF statement to ask for current measure or something like this. Please see bellow link I have written simple sample. How to write formula for "sum of A and B" --> Price combination?
Thanks

http://www.shrani.si/f/D/bj/1UmtvYpO/formula.png

Offline Royal Ascot

  • Senior Member
  • ****
  • Posts: 56
  • Forum Citizenship: +2/-0
might be try this

sum(quantity for a,b)
avg(sales price for a,b)

Offline MFGF

  • Never knowingly correct
  • Super Moderator
  • Statesman
  • ******
  • Posts: 3,112
  • Forum Citizenship: +152/-3
  • Cognos Software Muppet
How about using syntax along the lines of:

aggregate([quantity] within set ([Product A],[Product B]))

and

average([sales price] within set ([Product A],[Product B]))

Regards,

MF.

Meep!