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: 
priyarane
Specialist
Specialist

Value adding to other Periods

Hi Every one,

Currently below expression I am using.

if

(Trad_PRODUCT_TYPE = 'OTC Derivative',
aggr(sum(TOTAL<Trad_CRISP_PARENT_FULLNAME,Trad_PARENT, Trad_CLOSEOUT_AGREEMENT_NUMBER,Trad_PERIOD> Trad_UNREALIZED_PL),Trad_PARENT, Trad_CLOSEOUT_AGREEMENT_NUMBER,Trad_PERIOD),
if(Trad_PRODUCT_TYPE = 'SFT',
aggr(sum(TOTAL<Trad_CRISP_PARENT_FULLNAME,Trad_PARENT, Trad_CLOSEOUT_AGREEMENT_NUMBER,Trad_PERIOD> Trad_COLLATERAL_VALUE),Trad_PARENT, Trad_CLOSEOUT_AGREEMENT_NUMBER,Trad_PERIOD),
aggr(sum(TOTAL<Trad_CRISP_PARENT_FULLNAME,Trad_PARENT, Trad_CLOSEOUT_AGREEMENT_NUMBER,Trad_PERIOD> Trad_CURR_BOOK_VALUE),Trad_PARENT, Trad_CLOSEOUT_AGREEMENT_NUMBER,Trad_PERIOD)))

And my issue is P0 values, I need to add it to other periods. Refer screen shot.

ex:

P0   P1   P2   P3

10   5     3      25

Output should be

P0 + 0   P1+P0     P2+P0     P3+P0

10             15         13            35

Thank you,

Priya


4 Replies
giakoum
Partner - Master II
Partner - Master II

the same (terrible...) expression needs to be added but only for P0. You can use set analysis for that :

aggr(sum({<[Period]={"P0"}>} total .........etc

priyarane
Specialist
Specialist
Author

Hi Ioannis,

You mean to say,

+

if

(Trad_PERIOD='P0',0,aggr(sum(TOTAL<Trad_CRISP_PARENT_FULLNAME,Trad_PARENT, Trad_CLOSEOUT_AGREEMENT_NUMBER,Trad_PERIOD>{<Trad_PERIOD={'P0'}>} Trad_UNREALIZED_PL),Trad_PARENT, Trad_CLOSEOUT_AGREEMENT_NUMBER,Trad_PERIOD))


giakoum
Partner - Master II
Partner - Master II

yes you can do it with if also, but then your expression gets really complicated

priyarane
Specialist
Specialist
Author

Hi Ioannis,

my if statement not worked out.

Could you please elaborate your expression if possible?

Thank you,