Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Chart Caluclation

Hi Every one,

I have 5 asset classes in my chart and periods are P0 to P1, out of 5 asset classes 1 is OTC Derivative, when I make selection of OTC and Period=P0 values should be added to other periods(P1 to P15) and you can find current chart and it should be change to my requirement.

Make sure that this change should not reflect to other selections.

Current expression is: if(Trad_PRODUCT_TYPE = 'OTC Derivative',sum(Trad_UNREALIZED_PL), if(Trad_PRODUCT_TYPE = 'SFT',sum(Trad_COLLATERAL_VALUE),sum(Trad_CURR_BOOK_VALUE)))

Thanks for your help in advance.

Raj

36 Replies
sunny_talwar

Sum(DISTINCT Trad_UNREALIZED_PL) + If( Period = 'P0', 0, RangeSum(Above(sum(Trad_UNREALIZED_PL) ,RowNo()-1)))

or

Avg(Trad_UNREALIZED_PL) + If( Period = 'P0', 0, RangeSum(Above(sum(Trad_UNREALIZED_PL) ,RowNo()-1)))

Can you try and see if one of the two are working for you

Best,

S

Not applicable
Author

No results changed.

sunny_talwar

Can you take a screen shot of the expression which is doing P0+P0? I know you did post what you are using, but I just want to make sure everything is correct in the expression box.

Thanks,

S

Not applicable
Author


Hi S,

added.

Not applicable
Author

Hi S,

Its not worked out:

Avg(Trad_UNREALIZED_PL) + If( Period = 'P0', 0, RangeSum(Above(sum(Trad_UNREALIZED_PL) ,RowNo()-1)))

almost worked:

Sum

(Trad_UNREALIZED_PL) + If( Period = 'P0',0, RangeSum(Above(sum(Trad_UNREALIZED_PL) ,RowNo

()-1)))

but only thing P0 should not be calculte.

sunny_talwar

Can you create two separate expressions for testing purposes:

1) Sum (Trad_UNREALIZED_PL)

2) If( Period = 'P0',0, RangeSum(Above(sum(Trad_UNREALIZED_PL) ,RowNo()-1)))

Paste the image of the output chart.

Best,

S

Not applicable
Author

Added

sunny_talwar

Replace the first expression with this:

If(Period = 'P0', 0, Sum (Trad_UNREALIZED_PL))


If this expression now gives you 0 for 'P0' then you can use this as your final expression


If(Period = 'P0', 0, Sum(Trad_UNREALIZED_PL) + RangeSum(Above(sum(Trad_UNREALIZED_PL) ,RowNo()-1)))


Hope we can final resolve your issue here.


Best,

S

Not applicable
Author

Sorry SunIndia, Still its not working. I really thankful for trying hard.

sunny_talwar

Hahahaha not an issue. I am going to give it a one last try, if I can't figure out, than I guess I can't really be able to.

I want you to create these expressions and paste the image:

1) If(Period = 'P0', 0, Sum (Trad_UNREALIZED_PL))

2) If( Period = 'P0',0, RangeSum(Above(sum(Trad_UNREALIZED_PL) ,RowNo()-1)))

3) If(Period = 'P0', 0, Sum (Trad_UNREALIZED_PL)) + If( Period = 'P0',0, RangeSum(Above(sum(Trad_UNREALIZED_PL) ,RowNo()-1)))

4) If(Period = 'P0', 0, Sum (Trad_UNREALIZED_PL) + RangeSum(Above(sum(Trad_UNREALIZED_PL) ,RowNo()-1)))


Thanks,

S