cancel
Showing results for 
Search instead for 
Did you mean: 

Query Designer

0 Kudos

Hello All,

Could you please help me out in getting this straight as I am confused on  how to proceed in this.

scenario :

currently there is a formulae in our query which is using a key figure (C), and it is displaying correct value for all the company code except for 1 company code, so now the user says for that company code(X) use another key figure(D) in that same formulae.

current formulae :

total Cost = (a + b) + 'C'

here C is displaying correct value for all company code except for company code "X".

now the user want a different key figure 'D' to be used in this formulae that will display value for only company code 'X'.

please suggest guys.

Thanks in Advance!!

Best Regards,

Bharat Bansal

Accepted Solutions (0)

Answers (3)

Answers (3)

swati_gawade
Contributor
0 Kudos

Hi Bharat,

First try to figure out the reason for KF C not giving correct values for company code 'X'. Is there any functional or technical limitation for it? As the KF 'C' is currently not working for Company code 'X', check the possibility of it not working for any other company code as well.

you wouldn't want to create 1 KF for each such company code where KF 'C' does not work.

If 'X' is the only company code that does not statisfy the specification for KF C then you can go ahead with the suggestion given by Nanda and Loed, to create 2 separate KFs (local or re-usable as per your requirement) with restriction of Comp code <> X and second with Comp code = X.

As the first KF does not contain the Comp code X data, these 2 KFs will not have any overlapping data and the addition of these KF's should give you total result for all company codes. Hence achieving your requirement.

As per your new formula would be

total Cost = (a + b) + 'C' + 'D' . (where a and b are other existing operands, 'C' is KF for all company codes except 'X' and D if KF for Comp code 'X'.


Hope this helps.


-Swati.

Loed
Active Contributor
0 Kudos

Hi Bharat,

You need to create two (2) SELECTIONS..

1st selection composed of, let's call this ZSEL_1st:

Keyfigure C

Company Code (EXCLUDE company code X)

2nd selection composed of, let's call this ZSEL_2nd:

Keyfigure D

Company Code (INCLUDE company code X only)

Create a formula, let's call this ZFORM_ADD and add the two (2) selections above:

ZSEL_1st + ZSEL_2nd

HIDE the two (2) selections so that you will only have one (1) column for your keyfigure..

Regards,

Loed

ccc_ccc
Active Contributor
0 Kudos

Hi Bharat,

Create two calculated key figures:

1 Create calculated key figure with same formula and restrict with company code 'X'.(include)

2 Create second calculated key figure with same formula and restrict with company code 'X'.(Exclude)

Here the second one is D , as per your requirement.

Thank you,

Nanda

former_member194898
Active Contributor
0 Kudos

Hi,

Just small remark

For performance reasons it's better not to use exclusions. Including works faster.

e.g. for values A,D,C,D. If you have to choose A,B,C and not D choose A;B;C instead of !D.

Regards, Leszek