Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Set formula operation Error

Hello,

I want to do a difference of two expressions but the result is totally different that i expect:

Capture.PNG

Here the expression:

  • 1: =SUM( Value)/1000000

  • 2: =SUM({$<source = {'Costs_PC'}>}myVal)+SUM( { $< source = {'FTE_Activity'}>}myVal)/

SUM( TOTAL { 1< source = {'FTE_Activity'}, AsOf = {"=$(=GetFieldSelections(AsOf))"} >}myVal)*

SUM( TOTAL { 1< source = {'Allocated_Costs'}, AsOf = {"=$(=GetFieldSelections(AsOf))"} >}myVal)


  • 3: =(SUM(Value))/1000000 - SUM({$<source = {'Costs_PC'}>}myVal) + SUM( { $< source = {'FTE_Activity'}>}myVal)/

SUM( TOTAL { 1< source = {'FTE_Activity'}, AsOf = {"=$(=GetFieldSelections(AsOf))"} >}myVal)*

SUM( TOTAL { 1< source = {'Allocated_Costs'}, AsOf = {"=$(=GetFieldSelections(AsOf))"} >}myVal)

Do you have a idea please ?

Thanks in advance for your help,

Sébastien.

1 Solution

Accepted Solutions
MindaugasBacius
Partner - Specialist III
Partner - Specialist III

  • =(SUM(Value))/1000000 - SUM({$<source = {'Costs_PC'}>}myVal) - SUM( { $< source = {'FTE_Activity'}>}myVal)/

SUM( TOTAL { 1< source = {'FTE_Activity'}, AsOf = {"=$(=GetFieldSelections(AsOf))"} >}myVal)*

SUM( TOTAL { 1< source = {'Allocated_Costs'}, AsOf = {"=$(=GetFieldSelections(AsOf))"} >}myVal)


Use this. You missed one minus sign.


UPDATE:

  1. A
  2. B+C
  3. =A-B-C

View solution in original post

3 Replies
MindaugasBacius
Partner - Specialist III
Partner - Specialist III

  • =(SUM(Value))/1000000 - SUM({$<source = {'Costs_PC'}>}myVal) - SUM( { $< source = {'FTE_Activity'}>}myVal)/

SUM( TOTAL { 1< source = {'FTE_Activity'}, AsOf = {"=$(=GetFieldSelections(AsOf))"} >}myVal)*

SUM( TOTAL { 1< source = {'Allocated_Costs'}, AsOf = {"=$(=GetFieldSelections(AsOf))"} >}myVal)


Use this. You missed one minus sign.


UPDATE:

  1. A
  2. B+C
  3. =A-B-C
Anonymous
Not applicable
Author

Thanks a lot, it was exactly that !

Sébastien.

sunny_talwar

Although this is answered, but just wanted to add that you might benefit from doing a straight subtraction -> A-B to using RangeSum(A, -B)

=RangeSum(

Sum(Value)/1000000,

-(Sum({$<source = {'Costs_PC'}>}myVal) + Sum({$< source = {'FTE_Activity'}>}myVal)/

Sum(TOTAL {1< source = {'FTE_Activity'}, AsOf = {"=$(=GetFieldSelections(AsOf))"} >}myVal) *

Sum(TOTAL {1< source = {'Allocated_Costs'}, AsOf = {"=$(=GetFieldSelections(AsOf))"} >}myVal))

)