Loop

Create tables and reports with Dimensions scripting.

Loop

Postby jeetesh » Mon Mar 08, 2010 12:58 am

Hi All,

I have two questions QJMT and QJ15. QJMT has 16 categories and based on those 16 categories I have to shown QJ15 16 times as follows.

Tabledoc.Tables.AddNew("Table"+CText(tabledoc.Tables.Count +1), "qj15{B1 'Unweighted Total' base(),B2 'Base (excl. DKs)' base('qj15.containsany({Extremely_satisfied,Very_satisfied,Fairly_satisfied,Neither_satisfied_nor_dissatisfied,Fairly_dissatisfied,Very_dissatisfied,or_Extremely_dissatisfied})'),_
No_ans 'No Answer' expression('qj15.AnswerCount()=0 and qj15={_99_99}')}")
Tabledoc.Tables["table"+ctext(TableDoc.Tables.Count)].Annotations[1].Specification ="Qj15 15. Would you say you are satisfied or dissatisfied with the service you receive from - Unaddressed promotional mail/leaflets"Tabledoc.Tables["table"+ctext(TableDoc.Tables.Count)].Annotations[2].Specification ="Base : All answering"
Tabledoc.Tables["table"+ctext(TableDoc.Tables.Count)].Filters.AddNew("j15_15","qj15.answercount()>0 and qj15<>{_99_99} and qjmt={Unaddressed_promotional_mail_leaflets}")

Tabledoc.Tables.AddNew("Table"+CText(tabledoc.Tables.Count +1), "qj15{B1 'Unweighted Total' base(),B2 'Base (excl. DKs)' base('qj15.containsany({Extremely_satisfied,Very_satisfied,Fairly_satisfied,Neither_satisfied_nor_dissatisfied,Fairly_dissatisfied,Very_dissatisfied,or_Extremely_dissatisfied})'),_
No_ans 'No Answer' expression('qj15.AnswerCount()=0 and qj15={_99_99}')}")
Tabledoc.Tables["table"+ctext(TableDoc.Tables.Count)].Annotations[1].Specification ="Qj15 16. Would you say you are satisfied or dissatisfied with the service you receive from - Other business correspondence"Tabledoc.Tables["table"+ctext(TableDoc.Tables.Count)].Annotations[2].Specification ="Base : All answering"
Tabledoc.Tables["table"+ctext(TableDoc.Tables.Count)].Filters.AddNew("j15_16","qj15.answercount()>0 and qj15<>{_99_99} and qjmt={Other_business_correspondence}")

In the above code only the base description and filter is getting changed and the remaining whole script is same.
So, is there any way through which I can generate all 16 tables only by writing the script once instead of repeating the same code 16 times.

Thank you,
Jeetesh
jeetesh
 
Posts: 15
Joined: Fri Feb 19, 2010 5:29 am

Re: Loop

Postby James Corriveau » Mon Mar 08, 2010 8:29 am

Create a subroutine.

I would strongly suggest training. Looking back to your previous posts, you are missing basic fundamentals. I think it would help you a lot.

Best,
Jamey
James Corriveau
 
Posts: 108
Joined: Tue Sep 05, 2006 12:07 pm
Location: Cincinnati, OH

Re: Loop

Postby jeetesh » Mon Mar 08, 2010 8:58 am

Hi Jamey,

We are using Dimension since last 20 days hence not very well versed with it. We are just moving from Quantum to Dimension. We know the syntax for all the previous posts in Quantum but not in Dimension so just need your help(We are also gathering knowledge from DDL)..............

Thank you for your advice.......
jeetesh
 
Posts: 15
Joined: Fri Feb 19, 2010 5:29 am


Return to Tables Scripting

Who is online

Users browsing this forum: No registered users and 2 guests