Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
snarrp_Rocky
Contributor III
Contributor III

Need Help with expression

I have attached my QVW.

It has two Fig. Fig1 and Fig2.

My query is.

Fig 1.  I need to show both the dates (available dates) in the trend chart. In the calendar whatever the date is selected, the trend should show that data and its previous days data.

Fig2 . I need to show the portfolios/nodenames in one dimension or column. Like Credit & DCM, ST-Aust, Legacy, Debt/Credit AU only should appear in one column. I dont want to show "CorpDebt - Aust", like selectively I need to include portfolios. Your help is greatly appreciated.

1 Solution

Accepted Solutions
sunny_talwar

Try this

Min({<COBDate = {"$(='>=' & Date(Max({<COBDate = {[$(='<=' & Date(Max(COBDate)))]}>}COBDate, 2)) & '<=' & Date(Max(COBDate)))"}>}Aggr(Sum({<RiskContainer={"VAR_1D"},NodeName4={"Traded"}, COBDate = {"$(='>=' & Date(Max({<COBDate = {[$(='<=' & Date(Max(COBDate)))]}>}COBDate, 2)) & '<=' & Date(Max(COBDate)))"}>}PnL), ScenarioDateID, NodeName4, COBDate), 5)

View solution in original post

5 Replies
sunny_talwar

Is this what you are hoping to see?

image.png

snarrp_Rocky
Contributor III
Contributor III
Author

thanks for that Sunny.

I have one problem.

I had loaded same data for both the dates.

Now when I add data for 22nd June and remove 26th June which is duplicate data of 25th June. I still get as per my previous chart showed before your solution. Could you please check why 22nd and 25th Data not reflecting? I see only one data is reflecting which is making trend chart plain.

Best Regards

sunny_talwar

Try this

Min({<COBDate = {"$(='>=' & Date(Max({<COBDate = {[$(='<=' & Date(Max(COBDate)))]}>}COBDate, 2)) & '<=' & Date(Max(COBDate)))"}>}Aggr(Sum({<RiskContainer={"VAR_1D"},NodeName4={"Traded"}, COBDate = {"$(='>=' & Date(Max({<COBDate = {[$(='<=' & Date(Max(COBDate)))]}>}COBDate, 2)) & '<=' & Date(Max(COBDate)))"}>}PnL), ScenarioDateID, NodeName4, COBDate), 5)
snarrp_Rocky
Contributor III
Contributor III
Author

Works 🙂 Many thanks Sunny. !!
snarrp_Rocky
Contributor III
Contributor III
Author

One suggestion needed please, if we have two charts, both of them are dependent on the selection of the date in calendar, as you change the date in calendar, the data in both the charts changes. This is fine.
But if I want to restrict the selection of data in one chart, which should not impact other chart based on what is selected in chart 1. How I can do it, I guess with Alternate state we can do it . Other otion is , i need to set two calendar for both the charts which is not what I need to achieve with.
I guess expression like, COBDate=Alternatestates::COBDate is probable solution but I am stuck here. Could you please advise?
Regards