rules https://bihints.com/ en TM1 lint https://bihints.com/tm1-lint <span class="field field--name-title field--type-string field--label-hidden">TM1 lint</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p><a href="/sites/default/files/alias.pl">alias.pl</a> is a very basic <a class="ui-en_wikipedia_org" href="https://en.wikipedia.org/wiki/Lint_(software)">lint</a> tool whose task is to flag "dangerous" TM1 rules.<br /> For now it is only checking for aliases in rules.</p> <p>Indeed, if an alias is changed or deleted, any rule based on that alias will stop working without any warning from the system. The values will remain in place until the cube or its rules gets reloaded but you will only get a "silent" warning in the messages log after reloading the cube.</p> <p>How to proceed:<br /> .configure and execute the following TI process (to put in prolog), this will generate a list of all cubes and associated dimensions, and a dictionary of all aliases on the system in .csv format</p> <pre> ### PROLOG #configure the 2 lines below for your system report = 'D:\alias.dictionary.csv'; report1 = 'D:\cubes.csv'; # ############################################## #it is assumed that none of the aliases contain commas DataSourceASCIIQuoteCharacter = ''; ######create a list of all cubes and associated dimensions c = 1; while(c &lt;= DimSiz('}Cubes')); cube = DIMNM('}Cubes',c); d = 1; while(tabdim(cube,d) @&lt;&gt; ''); asciioutput(report1, cube, tabdim(cube, d)); d = d + 1; end; c = c + 1; end; ######create a dictionary of all aliases d = 1; while(d &lt;= DimSiz('}Dimensions')); dim = DIMNM('}Dimensions',d); #skip control dimensions If(SUBST(dim,1,1) @&lt;&gt; '}'); attributes = '}ElementAttributes_' | dim; #any aliases? If(DIMIX('}Dimensions',attributes) &lt;&gt; 0); a = 1; while(a &lt;= DimSiz(attributes)); attr = DIMNM(attributes,a); #is it an alias? If(DTYPE(attributes,attr) @= 'AA'); #go through all elements and report the ones different from the principal name e = 1; while(e &lt;= DimSiz(dim)); element = DIMNM(dim,e); If(element @&lt;&gt; ATTRS(dim,element,attr) &amp; ATTRS(dim,element,attr) @&lt;&gt; ''); asciioutput(report,dim,attr,ATTRS(dim,element,attr)); Endif; e = e + 1; end; Endif; a = a + 1; end; Endif; Endif; d = d + 1; end; </pre> <p>.configure and execute the perl script attached below<br /> that script will load the csv files generated earlier in hash tables, scan all rules files and finally report any aliases.</p> <p>If the element is ambiguous because it is present in 2 different dimensions then you should write it as <strong>dimension:'element'</strong> instead of using aliases (e.g. write Account:'71010' instead of '71010').</p> <p>related: <a href="https://web.archive.org/web/20120710041215/http://users.skynet.be/fa436118/wim/tm1ruleareadefinition.htm">Wim Gielis' rule area definition tool</a></p> </div> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/user/14" typeof="schema:Person" property="schema:name" datatype="">admin</span></span> <span class="field field--name-created field--type-created field--label-hidden">Tue, 2010-09-07 13:12</span> <div class="field field--name-field-categories field--type-entity-reference field--label-inline clearfix"> <div class="field__label">Categories</div> <div class="field__items"> <div class="field__item"><a href="/tm1/developers" hreflang="en">developers</a></div> <div class="field__item"><a href="/tm1/alias" hreflang="en">alias</a></div> <div class="field__item"><a href="/tm1/rules" hreflang="en">rules</a></div> </div> </div> <section class="field field--name-comment field--type-comment field--label-above comment-wrapper"> <h2 class="title comment-form__title">Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=25&amp;2=comment&amp;3=comment" token="zIcYfyx9x2R_eMpsZ9_uvNrYo5LC9hJAkmbrmdnOI5c"></drupal-render-placeholder> </section> Tue, 07 Sep 2010 11:12:59 +0000 admin 25 at https://bihints.com https://bihints.com/tm1-lint#comments Monitor rules and processes https://bihints.com/monitor-rules-and-processes <span class="field field--name-title field--type-string field--label-hidden">Monitor rules and processes</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>Changing a rule or process in TM1 does not show up in the logs.<br /> That is fine as long as you are the only Power User able to tinker with these objects.<br /> Unfortunately, it can get out of hand pretty quickly as more power users join the party and make changes that might impact other departments data.<br /> So here goes a simple way to report changes.</p> <p>The idea is to compare the current files on the production server with a backup from the previous day.</p> <p>You will need:</p> <ul><li>Access to the live TM1 Data Folder</li> <li>Access to the last daily backup</li> <li>A VB script to email results you can find one <a href="/send-email-attachments">there</a></li> <li><a href="/sites/default/files/diff.exe">diff</a>, <a href="/sites/default/files/egrep.exe">egrep</a> and <a href="/sites/default/files/unix2dos.exe">unix2dos</a><br />  </li> </ul><p>Save these files in D:\TM1DATA\BIN for example, or some path accessible to the TM1 server.</p> <p>In the same folder create a diff.bat file, replace all the TM1DATA paths to your configuration:</p> <pre> @echo off cd D:\TM1DATA\BIN del %~1 rem windows file compare fc is just crap, must fallback to the mighty GNU binutils diff -q "\\liveserver\TM1DATA" "\\backupserver\TM1DATA" | egrep "\.(pro|RUX|xdi|xru|cho)" &gt; %~1 rem make it notepad friendly, i.e. add these horrible useless CR chars at EOL, it's 2oo8 but native windows apps are just as deficient as ever unix2dos %~1 rem if diff is not empty then email results if %~z1 GTR 1 sendattach.vbs mailserver 25 from.email to.email "[TM1] daily changes log" " " "D:\TM1DATA\BIN\%~1" </pre> <p>Now you can set a TM1 process with the following line to run diff.bat and schedule it from a chore.</p> <pre> ExecuteCommand('cmd /c D:\TM1DATA\BIN\diff.bat diff.txt',0); </pre> <p>Best is to run the process at close of business, just before creating the backup of the day.</p> <p>And you should start receiving emails like these:</p> <pre> Files \\liveserver\TM1DATA\Check Dimension CollectionCat.pro and \\backupserver\TM1DATA\Check Dimension CollectionCat.pro differ Files \\liveserver\TM1DATA\Productivity.RUX and \\backupserver\TM1DATA\Productivity.RUX differ Only in \\liveserver\TM1DATA: Update Cube Branch Rates.pro </pre> <p>In this case we can see that the rules from the Productivity cube have changed today.</p> </div> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/user/14" typeof="schema:Person" property="schema:name" datatype="">admin</span></span> <span class="field field--name-created field--type-created field--label-hidden">Wed, 2008-08-06 12:14</span> <div class="field field--name-field-categories field--type-entity-reference field--label-inline clearfix"> <div class="field__label">Categories</div> <div class="field__items"> <div class="field__item"><a href="/tm1/admins" hreflang="en">admins</a></div> <div class="field__item"><a href="/tm1/backup" hreflang="en">backup</a></div> <div class="field__item"><a href="/tm1/monitor" hreflang="en">monitor</a></div> <div class="field__item"><a href="/tm1/rules" hreflang="en">rules</a></div> <div class="field__item"><a href="/tm1/shell" hreflang="en">shell</a></div> <div class="field__item"><a href="/tm1/versioning" hreflang="en">versioning</a></div> </div> </div> <section class="field field--name-comment field--type-comment field--label-above comment-wrapper"> <h2 class="title comment-form__title">Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=50&amp;2=comment&amp;3=comment" token="8WGO8ImBirMqhXncJ2JSiB-Mre32O1REXwH0equKyUQ"></drupal-render-placeholder> </section> Wed, 06 Aug 2008 10:14:05 +0000 admin 50 at https://bihints.com https://bihints.com/monitor-rules-and-processes#comments The fallacy of blb files https://bihints.com/fallacy-blb-files <span class="field field--name-title field--type-string field--label-hidden">The fallacy of blb files</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>TM1 system files with the <strong>blb</strong> extension, incorrectly referenced as "cube formatting" files (admin guide p.35) are actually "rule formatting" files for the "standard" rules editor (prior to 9.1).<br /> The rules editor actually displays the contents of the .blb if there is one, otherwise it defaults to the .rux.<br /> Unfortunately things can go wrong, and the .blb file gets desynchronised from the actual .rux or just go blank.<br /> As a result, what you see in the rule editor are NOT the rules attached to your cube and it becomes tricky to pinpoint any issue as the rule tracer gets confused too.</p> <p>A simple fix is to delete the associated .blb file in the TM1 Data folder and reopen the rules in the rule editor. Well it works only until the next time it goes desynchronised or blank.</p> <p>From 9.1, you can turn on the new rules editor from the tm1s.cfg:<br /><strong>AdvancedRulesEditor = T</strong></p> <p>Ultimately if you really cannot do without formatting, consider using an <a href="/turbo-integrator-highlighters">editor with highlighting features</a> and copy/paste the rules.</p></div> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/user/14" typeof="schema:Person" property="schema:name" datatype="">admin</span></span> <span class="field field--name-created field--type-created field--label-hidden">Fri, 2008-05-16 10:08</span> <div class="field field--name-field-categories field--type-entity-reference field--label-inline clearfix"> <div class="field__label">Categories</div> <div class="field__items"> <div class="field__item"><a href="/tm1/developers" hreflang="en">developers</a></div> <div class="field__item"><a href="/tm1/format" hreflang="en">format</a></div> <div class="field__item"><a href="/tm1/rules" hreflang="en">rules</a></div> </div> </div> <section class="field field--name-comment field--type-comment field--label-above comment-wrapper"> <h2 class="title comment-form__title">Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=24&amp;2=comment&amp;3=comment" token="il4vi1tuc-f9mTyd8cePW6m-r9oNOEJugFEvo25A8Aw"></drupal-render-placeholder> </section> Fri, 16 May 2008 08:08:43 +0000 admin 24 at https://bihints.com https://bihints.com/fallacy-blb-files#comments Dynamic formatting https://bihints.com/dynamic-formatting <span class="field field--name-title field--type-string field--label-hidden">Dynamic formatting</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>It is possible to preformat dynamic slices by using the Edit Element Formats button in the subset editor. However that formatting is static and will not apply to new elements of a slowly changing dimension. Also it takes a long time to load/save when you try to apply it to more than a few dozen elements.</p> <p>As an example, we will demonstrate how to dynamically alternate row colors in a TM1 report for a <em>Customer</em> dimension.</p> <p>.Open subset editor for the <em>Customer</em> dimension<br /> .Select some elements and click "Edit Elements Format"<br /> .the "Edit Element Formats" worksheet opens, just click Save as "colored row"</p> <p>this creates the <strong>}DimensionFormatStyles_<em>Customer</em></strong> dimension and the <strong>}DimensionFormats_<em>Customer</em></strong> cube.<br /> Now we can modify this cube with our rules.</p> <p>open the rules editor for the }DimensionFormats_Customer cube, add this:<br /><br /><code>#alternate row colors for all elements<br /> ['colored row','Cond1Type'] = S: '2';<br /> ['colored row','Cond1Formula1'] = S: '=MOD(ROW(),2)=1';<br /> ['colored row','Cond1InteriorColorIndex'] = S: '34';<br /> ['colored row','Cond2Type'] = S: '2';<br /> ['colored row','Cond2Formula1'] = S: '=MOD(ROW(),2)=0';<br /> ['colored row','Cond2InteriorColorIndex'] = S: '2';</code></p> <p>now slice a view with the <em>Customer</em> dimension, applying that "colored row" style.<br /> result:</p> <p><img alt="alternate rows colours" data-entity-type="file" data-entity-uuid="26b6a143-32bc-4f3a-8d5f-1dec77934476" src="/sites/default/files/inline-images/alternate-rows-colours.jpg" /></p> <p>To create a different style:</p> <ul><li>Edit one element from the "Edit element format", apply the desired formatting and save</li> <li>Note the new values of the measures in the }DimensionFormats_Customer cube for that element</li> <li>Reflect these changes in the rules to apply to all elements for that style</li> </ul><p> </p> <p> </p> </div> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/user/14" typeof="schema:Person" property="schema:name" datatype="">admin</span></span> <span class="field field--name-created field--type-created field--label-hidden">Thu, 2007-03-29 12:32</span> <div class="field field--name-field-categories field--type-entity-reference field--label-inline clearfix"> <div class="field__label">Categories</div> <div class="field__items"> <div class="field__item"><a href="/tm1/developers" hreflang="en">developers</a></div> <div class="field__item"><a href="/tm1/excel" hreflang="en">excel</a></div> <div class="field__item"><a href="/tm1/format" hreflang="en">format</a></div> <div class="field__item"><a href="/tm1/rules" hreflang="en">rules</a></div> <div class="field__item"><a href="/tm1/subset-editor" hreflang="en">subset editor</a></div> </div> </div> <section class="field field--name-comment field--type-comment field--label-above comment-wrapper"> <h2 class="title comment-form__title">Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=17&amp;2=comment&amp;3=comment" token="B_jr1cz7gicq8lxY4PqWeJI7K26EGwp7nNbZxPjUVjE"></drupal-render-placeholder> </section> Thu, 29 Mar 2007 10:32:00 +0000 admin 17 at https://bihints.com Rules https://bihints.com/rules <span class="field field--name-title field--type-string field--label-hidden">Rules</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>Dimension elements containing a single quote character (') require a <strong>double quote</strong> to be interpreted correctly by the rules engine.<br /> Example: <em>['department<strong>'</strong>s'] -&gt; ['department<strong>''</strong>s']</em></p> <p>One could use aliases without single quote characters too, however the rule would break if anything were to happen to these aliases. So it is best practice not to use single quote characters in your elements in the first place and if you really need them, then use the double quote in the rules.</p> <hr /><p><br /> After modifying cells through rules, the consolidations of these cells won't match the new values.<br /> To reconciliate consolidations add in your rules:</p> <pre> ['Total'] = <strong>ConsolidateChildren('<em>dimension</em>')</strong> </pre> </div> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/user/14" typeof="schema:Person" property="schema:name" datatype="">admin</span></span> <span class="field field--name-created field--type-created field--label-hidden">Fri, 2006-12-01 15:52</span> <div class="field field--name-field-categories field--type-entity-reference field--label-inline clearfix"> <div class="field__label">Categories</div> <div class="field__items"> <div class="field__item"><a href="/tm1/developers" hreflang="en">developers</a></div> <div class="field__item"><a href="/tm1/rules" hreflang="en">rules</a></div> </div> </div> <section class="field field--name-comment field--type-comment field--label-above comment-wrapper"> <h2 class="title comment-form__title">Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=20&amp;2=comment&amp;3=comment" token="jtHSIrb3ssKST-mcOv2EwGPqTrf6EHDsSXb8MjW_QiI"></drupal-render-placeholder> </section> Fri, 01 Dec 2006 14:52:47 +0000 admin 20 at https://bihints.com https://bihints.com/rules#comments