cancel
Showing results for 
Search instead for 
Did you mean: 

Using restricted Key figures for other calculations in IDT

Former Member
0 Kudos

Hi Experts,

I have created restricted key figures in  IDT and i want to have sum of those in third key figure.


Key figure1:
select:Sales
where: Country='UK'

Key figure2:
select:Profit
where: Country='USA'

Key figure3: (Required)
@Select(Measures\Key  figure1)+@Select(Measures\Key figure2)

in key figure 3 its summing up  the whole amount and its not considering @where caluse of key figure 1 and key  figure 2.

I am just concerned how this can be achived in IDT , what am i  doing wrong and do i have to create them in data foundation?
please help.

Thanks,

Haseeb

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

I found a solution for this that’s why I am replying to my own post.

@select will not include where clause of an object this logic need to be handled through case statement, so codes are as
follow.

Key Figure 1:

sum(case when tablename.country = 'UK'

then tablename.Sales

else 0

end)

Key Figure 2:

sum(case when tablename.country = 'USA'

then tablename.Profit

else 0

end)

Key Figure 3:

@Select(Measures\Keyfigure1)+@Select(Measures\Key figure2)

Thanks,

Haseeb

Former Member
0 Kudos

hi,

is the case works in this way?

have you tested it.....

i am not sure that's why i am asking...

thanx

ram

Former Member
0 Kudos

Yes I have tested it and i am getting the expected results

Answers (0)