Click here to Skip to main content
15,898,134 members

Comments by aakar (Top 12 by date)

aakar 16-Jul-21 10:43am View    
No, presently the code is single threaded, any leads would be much appreciated!
aakar 16-Jul-21 5:10am View    
Hi, my code which was working fine has run into issues. worse part is that it runs most of the times but at times I am getting a 401 "Unauthorized" error at the response step. Can you pls help?
aakar 11-Feb-21 21:46pm View    
Hi, I have split the 2 strings into 2 table variables. Now how do I loop through these and add the params to the SP one by one?
The 2 variables are as below :

@a
-----
[Deptname]
[Location]
[Column1]
[Column2]
[Column3]


@b
-------
testval1,
testval2,
30,
50,
60

and the code that I am using is :

declare @a varchar(100)

set @a = '[Deptname],[Location],[Column1],[Column2],[Column3]'

select
a.value('.', 'varchar(max)')
from
(select cast('<m>' + REPLACE(@a, ',', '<m>') + '' AS XML) as col) as A
CROSS APPLY A.col.nodes ('/M') AS Split(a)



declare @b varchar(100)

set @b = 'testval1','testval2','30','50','60'

select
b.value('.', 'varchar(max)')
from
(select cast('<m>' + REPLACE(@b, ',', '<m>') + '' AS XML) as col) as B
CROSS APPLY B.col.nodes ('/M') AS Split(B)

Can you please help?
aakar 9-Feb-17 8:41am View    
Hi Sonymon,

Thanks for the solution. It works fine, however I require 2 levels of Totals
i.e. Region Asset is Asia ex-Japan and Class is Bonds.
Therefore I would require both the Class Total as well as the Region Asset Total.

Your solution helped me get the Class Total across my dataset. How do I get the Region Asset Total as well?
aakar 6-Feb-17 0:54am View    
Region Asset Class Dividends PnL Bonus
Asia ex-Japan Bonds 10000 10000 10000
Asia ex-Japan Bonds 20000 20000 20000
Asia ex-Japan Bonds 30000 30000 30000
Asia ex-Japan Bonds 40000 40000 40000
Bonds Total 100000 100000 100000
Asia ex-Japan Total 153200 153200 153200

The o/p is required in the above format for each Region (i.e the outer group total) and the Asset Class (i.e the inner group total)

Hope I am clear...