on 03-20-2015 6:48 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.