We help IT Professionals succeed at work.

Crosstab-Multiple Selected values in powerscript variable

JatinVaishnav
on
Medium Priority
386 Views
Last Modified: 2013-12-26
Hi All,

How do I do multiple selection in a Crosstab object ? And depending on selection i want to do some processing. Consider following scenario:-

      Column1      Column2      Column3      Column4      Column5
      01/01/04      02/01/04      03/01/04      04/01/04      05/01/04
Row1                              
Row2      Selected      Selected      Selected            
Row3                              
Row4                              
Row5            Selected      Selected      Selected      
Row6                              
Row7                              
Row8      Selected      Selected      Selected      Selected      Selected
Row9                              
Row10                              

In the above crossatab object I have enabled the "Mouse Selection" property. Using control button on the keyboard I can do multiple selection within the crosstab. Now my question here is I want to store these selected values in powerscript variable like

for first row
     ls_str[1] = 'Row2'
     ld_from[1] = '01/01/04'
     ld_to[1] = '03/01/04'
next

for second row
     ls_str[2] = 'Row5'
     ld_from[2] = '02/01/04'
     ld_to[2] = '04/01/04'
next

for last row
     ls_str[3] = 'Row8'
     ld_from[3] = '01/01/04'
     ld_to[3] = '05/01/04'
next

pls. get back to me for any clarification.

awaiting for a solution...........

Comment
Watch Question

CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
CERTIFIED EXPERT

Commented:
Please close open questions.

Regards :)
namasi,
i think it will not fulfil jatin's requirement b'coz he wants the value of column heading in crosstab. not the value at cross-section of row and column.

so if in a cross-tab,
emp_code is as row and hire_date is as column and pay_amt is as value then your solution gives 'pay_amt' i.e. value.
but jatin wants hire_date i.e. column and rownumber

rownumber is not the problem only column heading value is the problem..

m i right ?
Have you tried this :

ls_selected_data = This.Object.DataWindow.Selected.Data)

--VIkas
Ignore the bracket......... :)
Also see :
dw_control.Object.DataWindow.Selected
This will return you the list of selected columns in the format :
startrow1/endrow1/startobj1/endobj1;startrow2/endrow2/startobj2/endobj2;...
Map this to wnat you got from This.Object.DataWindow.Selected.Data

Regards,
VIkas

Author

Commented:
Hi All,

Thanks for your reply.

I can't accept namasi's answer the same reason what sandeep has explained.

I have tried Vikas's solution also but i can't accept as it is giving the data within the column and not the column header.

I got the column header values from dw_1.Describe("t_2"+String(mid(ls_col,14))+".Text").

I owe half the points to namasi.

Bye


Thanks
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.