<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>instantOLAP &#187; HowTos</title>
	<atom:link href="http://www.instantolap.com/category/howtos/feed" rel="self" type="application/rss+xml" />
	<link>http://www.instantolap.com</link>
	<description>Business intelligence for the Java Platform</description>
	<lastBuildDate>Thu, 21 Jan 2010 10:45:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Overlay charts</title>
		<link>http://www.instantolap.com/howtos/overlay-charts#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://www.instantolap.com/howtos/overlay-charts#comments</comments>
		<pubDate>Wed, 20 Jan 2010 21:36:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HowTos]]></category>
		<category><![CDATA[Chart]]></category>
		<category><![CDATA[Multiple Range]]></category>
		<category><![CDATA[Overlay Chart]]></category>

		<guid isPermaLink="false">http://www.instantolap.com/?p=462</guid>
		<description><![CDATA[We&#8217;ve been asked how to realize an overlay chart and how to place multiple ranges inside a single chart, so this article will show, using a simple example, how to do this.

Basically, each chart in instantOLAP is bound to a single pivot table. Overlay charts work generally in the same way, but because an overlay [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve been asked how to realize an overlay chart and how to place multiple ranges inside a single chart, so this article will show, using a simple example, how to do this.</p>
<p><img class="alignnone size-full wp-image-757" title="overlay1" src="http://www.instantolap.com/wp-content/uploads/2010/01/overlay1.png" alt="overlay1 Overlay charts" width="604" height="422" /></p>
<p><span id="more-462"></span>Basically, each chart in instantOLAP is bound to a single pivot table. Overlay charts work generally in the same way, but because an overlay chart is composed from two or more charts, we will also need more than one pivot table to feed the chart with data &#8211; each table feeds a single chart. So the first step is to create a block which contains multiple tables.</p>
<h3>Providing the chart data</h3>
<p>To create the first table, just use the &#8220;New pivot table&#8221; button from the right toolbar of the query editor. A new block, containing a single and empty table, will appear. Now drag a fact and a data series to the table, in out example this will be the &#8220;Amount&#8221; Fact and PRODUCT level from the Product dimension of the instantOLAP demo model.</p>
<p><img class="alignnone size-full wp-image-770" title="overlay2" src="http://www.instantolap.com/wp-content/uploads/2010/01/overlay21.png" alt="overlay21 Overlay charts" width="206" height="68" /></p>
<p>Now you can add a second pivot table to the existing block by opening the context menu of the block (use the right mouse button on the title bar of the block). Use the menu item &#8220;Add pivot table&#8221; of the menu to add a second and emtpy table.</p>
<p><img class="alignnone size-full wp-image-772" title="overlay4" src="http://www.instantolap.com/wp-content/uploads/2010/01/overlay4.png" alt="overlay4 Overlay charts" width="246" height="164" /></p>
<p>Because we want the new table to show data for the same samples, you should use the same iteration for the x-axis of the new new table as you did in the previous table. Only the fact in the y-axis will be a different one, in our example we will use the &#8220;Quantity&#8221; fact from the demo model.</p>
<p><img class="alignnone size-full wp-image-771" title="overlay3" src="http://www.instantolap.com/wp-content/uploads/2010/01/overlay31.png" alt="overlay31 Overlay charts" width="206" height="110" /></p>
<p>This was the basic step for each chart generation: creating the source table(s) for your chart.</p>
<h3>Setting the chart format</h3>
<p>It&#8217;s time to turn the table into chart: Use the context menu of the block and choose one of the overlay chart types. In out example we&#8217;ll use the &#8220;Bar / Line&#8221; chart which turns the first table into a bar chart and the second into a line chart.</p>
<p>If you execute the query now, you may recognize that there are really two charts, but the second one (the line chart) only displays a flat line at the bottom of the image. This is because till now both charts share the same range and the values for the fact &#8220;Amount&#8221; much bigger than for the fact &#8220;Quantity&#8221; (or its line). Therefire it&#8217;s down to the bottom. and we&#8217;ll have to add a second range to the chart and to scale the line to this new range.</p>
<h3>Creating a second range</h3>
<p>First of all you&#8217;ll have to activate the second range. There is a property named &#8220;Range 2 On&#8221; which has to be set to &#8220;true&#8221;. If you execute the query now you will see a second range, but the rest of the chart will look like before, including the  flat line chart.</p>
<p><img class="alignnone size-full wp-image-774" title="overlay6" src="http://www.instantolap.com/wp-content/uploads/2010/01/overlay6.png" alt="overlay6 Overlay charts" width="602" height="420" /></p>
<p>This is because you must assign each of the chart to the ranges. By default, both charts are assigned to the range number 1, which is the default range at the left side of the chart. To re-assign the second (the line) chart to the new range at the right side, use the property &#8220;(Overlay) Series Range&#8221; property and set it to &#8220;2&#8243; (use &#8220;1&#8243; for the first range and &#8220;2&#8243; for the second). If you execute the query now you&#8217;ll recognize the line beeing scaled over the full image.</p>
<p><img class="alignnone size-full wp-image-757" title="overlay1" src="http://www.instantolap.com/wp-content/uploads/2010/01/overlay1.png" alt="overlay1 Overlay charts" width="604" height="422" /></p>
<p>Now, you have created an overlay chart with two source tables and two ranges.</p>
<p> </p>
	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li>No related posts.</li>
	</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.instantolap.com/howtos/overlay-charts/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JDBC drivers</title>
		<link>http://www.instantolap.com/howtos/jdbc-drivers#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://www.instantolap.com/howtos/jdbc-drivers#comments</comments>
		<pubDate>Mon, 18 Jan 2010 13:12:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HowTos]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[JDBC]]></category>

		<guid isPermaLink="false">http://www.instantolap.com/?p=508</guid>
		<description><![CDATA[Before you can connect a database server with instantOLAP or any other Java application, you need a to install a matching database driver. For Java systems, you will need a driver which implements the Java JDBC standard and almost all database vendors provide a JDBC driver for their product.
Because of copyright reasons, only a few [...]]]></description>
			<content:encoded><![CDATA[<p>Before you can connect a database server with instantOLAP or any other Java application, you need a to install a matching database driver. For Java systems, you will need a driver which implements the Java JDBC standard and almost all database vendors provide a JDBC driver for their product.</p>
<p>Because of copyright reasons, only a few drivers are included in the instantOLAP standard distribution (an open source driver for Sybase and Microsoft SQL-Server and a second driver for HSQLDB databases). For all other database servers, you can find the driver in the internet. This is a list of the common database servers and some internet addresses where to find the driver.</p>
<p><span id="more-508"></span></p>
<h2>How to install a new driver under Tomcat</h2>
<p>If you use Apache Tomcat as your Application Server (which is the default Application Server installed together with instantOLAP), installing a new driver is very simple:</p>
<ol>
<li>Download the driver from the vendors driver page</li>
<li>If neccesary, extract the driver or execute the driver installer to extract the driver files onto your hard disk.</li>
<li>Locate the driver files (they always end with .jar) and copy them into the library folder of your Tomcat server. Depending on the Tomcat version, the library folder is &lt;tomcat&gt;/common/lib (for Tomcat 5.5) or &lt;tomcat&gt;/lib (for Tomcat 6)</li>
<li>Restart Tomcat</li>
</ol>
<h2>How to use drivers in instantOLAP</h2>
<p>After you installed the driver in your Application Server you can use from instantOLAP. Generally there are two different ways to access a driver or database: You can connect the server directly out of instantOLAP or you can use a predefined datasource, which has to be prepared inside the Application Server. For testing, developing or small installations, we recommend the first alternative.</p>
<p>To connect a database directly out of instantOLAP, simply use the &#8220;Add datasource&#8221; button when you are inside the &#8220;Datasources&#8221; section of a configuration. This will open a datasource wizard, which asks you for the name, driver, connection URL and credentials of the target database. Refer our <a href="http://www.instantolap.com/docs/reference_2_6_1_en/4_3_1.html#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">online documentation</a> for more details.</p>
<h2>JDBC drivers for database servers</h2>
<h3>Microsoft SQL-Server</h3>
<p>There are at least two good drivers for the Microsofts SQL-Server: The <strong>original Microsoft JDBC driver</strong> and the open source driver <strong>jDTS </strong>for Microsoft SQL and Sybase databases, which is included in the instantOLAP standard distribution.</p>
<h4>Microsoft SQL-Server (original driver)</h4>
<p>The original Microsoft JDBC driver can be found and downloaded from the Microsoft page.</p>
<ul>
<li>Download: <a rel="nofollow" target="_blank" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=99B21B65-E98F-4A61-B811-19912601FDC9&amp;displaylang=en">Microsoft SQL Server JDBC Driver 2.0</a></li>
<li>Driver file(s): sqljdbc.jar</li>
<li>Driver class: com.microsoft.sqlserver.jdbc.SQLServerDriver</li>
<li>Connection-URL: jdbc:sqlserver://&lt;server&gt;[:&lt;port&gt;];databasename=&lt;database&gt;</li>
</ul>
<p>Escpecially in older versions of the originial driver, it is important to know how to form the connection URL. You must include the database name in your URL, otherwise you will be able to see the tables but not to access their content.</p>
<h4>Microsoft SQL-Server (jDTS open source driver)</h4>
<p>jDTS is an open source alternative for Microsoft SQL and Sybase databases and already included in the instantOLAP standard distribution.</p>
<ul>
<li>Download: <a rel="nofollow" target="_blank" href="http://jtds.sourceforge.net/">http://jtds.sourceforge.net</a></li>
<li>Driver files(s):Â  jdts-&lt;version&gt;.jar</li>
<li>Driver class: net.sourceforge.jtds.jdbc.Driver</li>
<li>Connection-URL: jdbc:jtds:sqlserver://&lt;server&gt;[:&lt;port&gt;][/&lt;database&gt;]</li>
</ul>
<h3>MySQL</h3>
<p>When using MySQL databases, make sure to use the most current available driver version, because older drivers may cause problems with newer versions of the database.</p>
<ul>
<li>Download page: <a rel="nofollow" target="_blank" href="http://dev.mysql.com/downloads/#connector-j">http://dev.mysql.com/downloads/#connector-j</a></li>
<li>Driver file(s): mysql-connector-java-&lt;version&gt;-bin.jar</li>
<li>Driver class: com.mysql.jdbc.Driver</li>
<li>Connection-URL: jdbc:mysql://&lt;server&gt;/&lt;database&gt;</li>
</ul>
<h3>Oracle</h3>
<p>For Oracle databases it is imporant to use the correct version of the driver which matches the version of your database server. The drivers for all version can be downloaded from the Oracle page, but you will need to create an account before (if you don&#8217;t have already).</p>
<ul>
<li>Download: <a rel="nofollow" target="_blank" href="http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html">Oracle JDBC/UCP Download Page</a></li>
<li>Driver file(s): ojdbc15.jar or ojdbc16.jar</li>
<li>Driver class: oracle.jdbc.driver.OracleDriver</li>
<li>Connection-URL: jdbc:oracle:thin:@&lt;server&gt;:1521:&lt;database&gt;</li>
</ul>
<h3>Sybase</h3>
<p>Like in the case of Microsoft SQL Server, you can use the original Sybase driver or the open source driver jDTS to connect a Sybase driver.</p>
<h4>Sybase (original Sybase driver jConnect)</h4>
<ul>
<li>Download: <a rel="nofollow" target="_blank" href="http://www.sybase.com/products/allproductsa-z/softwaredeveloperkit/jconnect">jConnect &#8211; Software Developer Kit</a></li>
<li>Driver file(s): jconn3.jar</li>
<li>Driver class: com.sybase.jdbc2.jdbc.SybDriver</li>
<li>Connection-URL: jdbc:sybase:Tds:&lt;server&gt;[:&lt;port&gt;]/&lt;database&gt;</li>
</ul>
<h4>Sybase (jDTS open source driver)</h4>
<p>jDTS is an open source alternative for Microsoft SQL and Sybase databases and already included in the instantOLAP standard distribution.</p>
<ul>
<li>Download: <a rel="nofollow" target="_blank" href="http://jtds.sourceforge.net/">http://jtds.sourceforge.net</a></li>
<li>Driver file(s): jtds-&lt;version&gt;.jar</li>
<li>Driver class: net.sourceforge.jtds.jdbc.Driver</li>
<li>Connection-URL: jdbc:jtds:sybase://&lt;server&gt;[:&lt;port&gt;][/&lt;database&gt;]</li>
</ul>
<h3>IBM DB/2</h3>
<p>For all current versions of DB/2 you can use the Universal Database Driver (UDB) from DB/2. However, when you wan&#8217;t to connect a DB/2 database running on a mainframe system, you&#8217;ll have to purchase an additional license from IBM.</p>
<ul>
<li>Download: <a rel="nofollow" target="_blank" href="http://www-01.ibm.com/software/data/db2/ad/java.html">IBM &#8211; Application Development with DB/2</a> (Follow the links and download the DB/2 client)</li>
<li>Driver file(s): db2jcc.jar</li>
<li>Driver class: com.ibm.db2.jcc.DB2Driver</li>
<li>Connection-URL: jdbc:db2://&lt;server&gt;[:&lt;port&gt;]/&lt;database&gt;</li>
</ul>
<h3>Informix</h3>
<p>Since IBM bought the Informix database, you can find the Informix drivers on the IBM homepage now, too:</p>
<ul>
<li>Download: <a rel="nofollow" target="_blank" href="http://www14.software.ibm.com/webapp/download/search.jsp?go=y&amp;rs=ifxjdbc">IBM Software Downloads</a></li>
<li>Driver file(s): ifxjdbc.jar</li>
<li>Driver class: com.informix.jdbc.IfxDriver</li>
<li>Connection-URL: jdbc:informix-sqli://&lt;host&gt;:&lt;port&gt;/&lt;database&gt;:informixserver=&lt;dbservername&gt;</li>
</ul>
	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li>No related posts.</li>
	</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.instantolap.com/howtos/jdbc-drivers/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remote control your OLAP server</title>
		<link>http://www.instantolap.com/howtos/remote-control-olap-server#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://www.instantolap.com/howtos/remote-control-olap-server#comments</comments>
		<pubDate>Mon, 24 Aug 2009 17:11:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HowTos]]></category>
		<category><![CDATA[Console]]></category>
		<category><![CDATA[Remote control]]></category>

		<guid isPermaLink="false">http://www.instantolap.com/?p=209</guid>
		<description><![CDATA[The instantOLAP console allows to remote control you OLAP server, e.g. to rebuild a dimension or model after the source database changed. Learn about how to use the console and its commands.]]></description>
			<content:encoded><![CDATA[<p>There is an almost unknown tool within every instantOLAP installation, the <strong>instantOLAP Console</strong>, which allows to remote-control your instantOLAP server and to start, stop or rebuild models, to rebuild single dimensions or cubes or to perform a number of other operations.</p>
<p>The tool is very useful whenever instantOLAP loads its data from a data-warehouse and you want to rebuild certain models, dimensions or cubes after the ETL tool rebuild the warehouse or added new data to it.</p>
<p>This article describes, how to use the tool from batch-files or other Java applications (most ETL tools can call native Java commands) and which operations are available.</p>
<p><span id="more-209"></span></p>
<p>The console is delivered as a simple Java archive (jar file) and is located in the folder &lt;instantOLAP&gt;/tools/console. You can use the archive from this location or copy it to another computer &#8211; no other resource (except a local Java installation) is needed to execute the application.</p>
<h2>Starting the console (interactive mode)</h2>
<p>To start the console in the interactive mode, use the command:</p>
<pre>java -jar iolapConsole.jar &lt;server-url&gt; &lt;user&gt; &lt;password&gt;</pre>
<p>where &lt;server-url&gt; is the complete url to the backend-service of your instantOLAP-server and &lt;user&gt; and &lt;password&gt; are the credentials for your administrator account. E.g. the command for a local installation on port 8080 and with the administrator account would be:</p>
<pre>java -jar iolapConsole.jar http://localhost:8080/iolapWS admin admin</pre>
<p>If the jar file is not located in the current folder, you can also type its whole path (relative or absolute). After you logged successfully into the server, you will see the following welcome message:</p>
<pre>instantOLAP console
(c) 2006-2009 Thomas Behrends Softwareentwicklung e.K.
Connecting server http://localhost:8080/iolapWS...
ok
&gt;</pre>
<p>Now you can use one of following commands to control the server:</p>
<h2>Commands</h2>
<h3>BUILDDIMENSION &lt;model&gt; &lt;dimension&gt;</h3>
<p>This command rebuilds a single dimension of a model (and all dimensions being dependend on this). The command expects the model name and dimension name as argument.</p>
<p>Example:</p>
<pre>&gt; BUILDDIMENSION demo/demo Product
Building dimension Product of model demo/demo...</pre>
<h3>BUILDDIMENSIONS &lt;model&gt;</h3>
<p>This command rebuilds all dimensions of the specified model. The only argument the command expects is the name of the model.</p>
<p>Example:</p>
<pre>&gt; BUILDDIMENSIONS demo/demo
Building dimensions of model demo/demo...</pre>
<h3>BUILDSTORE &lt;model&gt; &lt;store&gt;</h3>
<p>The command BUILDSTORE rebuilds a single store of the specified model, the store name has to be passed as second argument.</p>
<p>Example:</p>
<pre>&gt; BUILDSTORE demo/demo store1
Building store store1 of model demo/demo...</pre>
<h3>BUILDSTORES &lt;model&gt;</h3>
<p>Rebuilds all stores of the specified model.</p>
<p>Example:</p>
<pre>&gt; BUILDSTORES demo/demo
Building stores of model demo/demo...</pre>
<h3>CLEARCACHE &lt;cache&gt;</h3>
<p>Use the command CLEARCACHE to empty a single cache of the model. After the execution, the cache still exists but contains no entries.</p>
<p>Example:</p>
<pre>&gt; CLEARCACHE demo/demo cache1
Clearing cache cache1 of model demo/demo...</pre>
<h3>CLEARCACHES</h3>
<p>This command clear all caches of the specified model.</p>
<p>Example:</p>
<pre>&gt; CLEARCACHES demo/demo
Clearing caches of model demo/demo...</pre>
<h3>CLEARSTORE &lt;model&gt; &lt;store&gt;</h3>
<p>Clears a single store of the model and brings it into the &#8220;offline&#8221; state. Dependend on the configuration settings, the model will continue using the original adhoc version of the store, otherwise the system will immediatley start to rebuild the store again.</p>
<p>Example:</p>
<pre>&gt; CLEARSTORE demo/demo store1
Clearing store store1 of model demo/demo...</pre>
<h3>CLEARSTORES &lt;model&gt;</h3>
<p>This command clears all stores of the model. Like in the CLEARSTORE command, the system will immediatley rebuild all stores dependend on the configuration settings.</p>
<p>Example:</p>
<pre>&gt; CLEARSTORES demo/demo
Clearing stores of model demo/demo...</pre>
<h3>LISTDIMENSIONS &lt;model&gt;</h3>
<p>This command returns a list of all dimensions of the specified model.</p>
<p>Example:</p>
<pre>&gt; LISTDIMENSIONS demo/demo
Agency
Anim
Campaigns
Manufacturer
Product
Time</pre>
<h3>LISTMODELS</h3>
<p>Returns a list of all models on your server, including the active and inactive ones. For each model, the current state is append as text. The following states are possible:</p>
<ul>
<li>ONLINE: The model is started and ready</li>
<li>BUILD: The model is currently starting</li>
<li>CLOSED: The model is currently not started</li>
<li>CLOSING: The model is currently shutting down</li>
<li>SYNC: The model is started and currently synchronizing its dimensions and / or cubes</li>
<li>ERROR: The model is not started because an error ocurred while starting it</li>
</ul>
<p>Example:</p>
<pre>&gt; LISTMODELS
demo/demo (ONLINE)
eventlog/eventlog (ONLINE)</pre>
<h3>MODELSTATE &lt;model&gt;</h3>
<p>This function returns the state of a specific model. The state is returned as number in this functions, the following states are possible:</p>
<ul>
<li>0 = CLOSED</li>
<li>1 = BUILD</li>
<li>2 = ONLINE</li>
<li>3 = SYNC</li>
<li>4 = ERROR</li>
<li>5 = CLOSING</li>
</ul>
<p>Example:</p>
<pre>&gt; MODELSTATE demo/demo
Request model-state for demo/demo...
State = 2</pre>
<h3>QUIT</h3>
<p>This command stops the console.</p>
<h3>STARTSYNC &lt;model&gt; &lt;timeout&gt;</h3>
<p>This function starts the synchronize process for a model, in which it is checking its cubes and dimensions if they are outaged. You must pass the timeout for the synchronize process in ms as second argument. This function is only useful if you want to synchronize the model immediatly, because the system synchronizes all its online models each minute.</p>
<p>Example:</p>
<pre>&gt; STARTSYNC demo/demo 1000
Starting model demo/demo synchronize...</pre>
<h3>STOP &lt;model&gt;</h3>
<p>This command shuts down the specified model.</p>
<p>Example:</p>
<pre>&gt; STOP demo/demo
Stopping model demo/demo...
ok</pre>
<h3>START &lt;model&gt;</h3>
<p>This command starts the specified model.</p>
<p>Example:</p>
<pre>&gt;START demo/demo
Starting model demo/demo asynchron...</pre>
<h2>Using the console in batch mode</h2>
<p>The batch mode can be used to call the console from external batch files and to execute commands without user interaction. To execute a command, just add it and its arguments behind the standard arguments of the console, the syntax for the batch mode is:</p>
<pre>java -jar iolapConsole.jar &lt;server&gt; &lt;user&gt; &lt;pwd&gt; &lt;command&gt; [&lt;arg1&gt; [&lt;arg2&gt; [...] ] ]</pre>
<p>If you call the console in batch mode, it will immediatley execute the passed command and then exit. E.g. the following line</p>
<pre>java -jar iolapConsole.jar http://localost:8080/iolapWS admin admin START demo/demo</pre>
<p>would start the model &#8220;demo/demo&#8221; on a local server running on port 8080 and then return.</p>
<p>Not that all commands, also in the interactive mode, only fork the requested operation on the server and then return without waiting for the operation to be finished. However, if you send a number of commands for the same model to server, they will be queued and executed in sequential order.</p>
	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li>No related posts.</li>
	</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.instantolap.com/howtos/remote-control-olap-server/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Implementing data-based user access rules</title>
		<link>http://www.instantolap.com/howtos/implementing-data-based-user-access-rules#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://www.instantolap.com/howtos/implementing-data-based-user-access-rules#comments</comments>
		<pubDate>Mon, 15 Dec 2008 13:59:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HowTos]]></category>
		<category><![CDATA[User management]]></category>

		<guid isPermaLink="false">http://www.instantolap.com/?p=125</guid>
		<description><![CDATA[Some of our customers asked how to implement access rules (for dimensions and keys) based on data stored in their database. This is useful e.g. for sales information systems where sales representives only may see customers of the region they are responsible for and if this representive/region relationship is stored in the database.

This article describes [...]]]></description>
			<content:encoded><![CDATA[<p>Some of our customers asked how to implement access rules (for dimensions and keys) based on data stored in their database. This is useful e.g. for <a title="sales" href="http://www.instantolap.com/sales">sales</a> information systems where sales representives only may see customers of the region they are responsible for and if this representive/region relationship is stored in the database.</p>
<p><span id="more-125"></span></p>
<p>This article describes how to implement such access rules in two steps for the customer / region example.</p>
<h3>Step 1: Add a user dimension to your model</h3>
<p>Before you can use the user information in access rules, you must make them available inside the model. The only ways to do this is to load the information into a dimension. Use normal SQL-KeyLoader to access the user-database and to load the user information. There are two basic rules when creating a user dimension:</p>
<ul>
<li>The dimension must at least contain the <span style="text-decoration: underline;">exact</span> user-IDs at keys. The user keys can be loaded to the top-level or they can be grouped (e.g. to users groups), but they must be inside the dimension and contain the login-IDs.</li>
<li>All IDs for keys from other dimension to which the user should have access to must be stored as attributes in the user-keys. E.g. the list of all region IDs could be loaded as attribute &#8220;regions&#8221;. Later, you can use this attribute to match its values with the region-keys.</li>
</ul>
<h3>Step 2: Add access rules to your other dimensions</h3>
<p>Now you can add access rules to your other dimension by referencing the current user-key and its attributes. Switch to the access rule editor by selecting the &#8220;Access&#8221; tabulator and start adding the rules to the dimension, e.g. to this &#8220;Customer&#8221; dimension.</p>
<p>The first part of your access rule has to find the current user key in the &#8220;User&#8221; dimension, because the user key is not automatically selected when the user executes a query. You could select the user in the query itself (in its &#8220;Filter&#8221; property) or you can use the FIND function in the access rules. The last solution is the better one because in this case you does not need to change every query (and you cannot forget this in future queries). The expression to find the current user is:</p>
<pre>FIND( User, USER() )</pre>
<p>where &#8220;User&#8221; is the name of your user dimension (you need to change it if your user-dimension has a different name). The function USER returns the name of the current user (his login). Because we search with the users login-name, it must exactly match the ID of the key in your dimension.</p>
<p>After you located the user key, you can use its attributes. E.g. if the user key has an attribute &#8220;regions&#8221;, which contains alle region id the user should have access to, the expression</p>
<pre>FIND( User, USER() ).regions</pre>
<p>will return the region codes. The result can contain no, one or multiple values (of course, a sales representive could be more responsible for more than one region).</p>
<p>Now the last thing is to match this region codes with the customer dimension. It is important to use relative expressions here and to match the REGION level (!) with the attribute, not the keys of the Customer dimension. E.g. the expression</p>
<pre>{REGION} IN FIND( User, USER() ).regions</pre>
<p>would convert the region name of the current customer, region (or whatever currently is selected) into a string and test its occurence in the region list of the user. Because REGION is a relative expression, this works for all levels of dimension: A customer is only visible if it belongs to a listed region, the regions itself is only visible if listed, and the root key of the Customer dimesion is only visible if one of the regions is listed.</p>
<p>Of course, you could also match the lowest level or match more than one level, but in most cases this is the typical expression we use for access restrictions. Sometimes it is neccesary to use dimension links &#8211; e.g. if the customer and region are stored in different dimensions, you would have to change the expression into something like:</p>
<pre>{CUSTOMER.region} IN FIND( User, USER() ).regions</pre>
<p>This only works, if the customer and region dimension are linked.</p>
<p>The last step is to add access rules for administrators or CEOs, which usually are allowed to see all keys of all dimensions. This can be done by a role-check in an additional access rule. The simple expression</p>
<pre>HASROLE( 'iolapAdmin' )</pre>
<p>would grant access to all keys for a user owning the role &#8220;iolapAdmin&#8221;. The expression always returns &#8220;true&#8221; if the user own this role, independend on the keys.</p>
	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li>No related posts.</li>
	</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.instantolap.com/howtos/implementing-data-based-user-access-rules/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;Query too complex&#8221;?</title>
		<link>http://www.instantolap.com/howtos/query-too-complex#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://www.instantolap.com/howtos/query-too-complex#comments</comments>
		<pubDate>Fri, 05 Dec 2008 13:37:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HowTos]]></category>
		<category><![CDATA[Query too complex]]></category>

		<guid isPermaLink="false">http://www.instantolap.com/?p=106</guid>
		<description><![CDATA[Ever experienced a "Query too complex" message when running a report in instantOLAP? Read here to solve the problem.]]></description>
			<content:encoded><![CDATA[<p>Because instantOLAP is usable as &#8220;adhoc&#8221; ROLAP tool, there is a maximum complexity for reports and a maximum number of loadable cube cells. When using adhoc-cubes, the system has to determine where to load which data from and which data is needed to populate the result or to calculate formulas.</p>
<p><span id="more-106"></span></p>
<p>This must be done <em>before </em>sending any SQL statement to the databases and in instantOLAP this is realized with the internal &#8220;ToDo List&#8221;, which lists all needed cells and tries to resolve the source for each cell (when running a reports, you can see the generation of the ToDo-List in the Log). There is a maximum size for ToDo-Lists, and if the lists exceed this limit, the system raises the &#8220;Query too complex&#8221; error. The default maximum size for this ToDo-List is 250.000 cells, but it can be changed easily in the configuration. However, increasing the maximum will result in longer running and more memory-using reports.</p>
<p>There are several possible strategies to avoid large ToDo-List, and some of them are only available in our new version 2.5 or later:</p>
<ol>
<li><strong>Try to calculate as much as possible inside the database:</strong> E.g. if you only have a &#8220;Quantity&#8221; and &#8220;Product price&#8221; stored in the database, the &#8220;Turnaround&#8221; (calculated by Quantity * Price) could be realized with a formula. But this formula would add 2 additional entries to the ToDo-List (for each &#8220;Turnaround&#8221; cell, an additional &#8220;Quantity&#8221; and &#8220;Price&#8221; would be necessary) and the list would become three times bigger than needed. If you use the database to calculate this fact and use a SQL expression like &#8220;SUM( table1.quantity * table.price)&#8221;, the SQL cube could deliver the fact on itself and the ToDo-List would remain small.</li>
<li><strong>Use LOOKUPs:</strong> When creating large and sparse reports, where only a small percentage of the cells will be filled with data, instantOLAP will also generate ToDo-Entries for this empty cells. If you use the LOOKUP function to eliminate empty rows or columns in ahead, you can reduce the size of the ToDo-List dramatically.</li>
<li><strong>CLUSTER your selections:</strong> One of the main reasons for large ToDo-Lists are multiple- and range-selectors. E.g. if you have a small pivot table but a range-selector for months and a display aggregated fact (like SUM(Amount()) in your cells, the system will need to load the amount for each cell in combination with each selected month. So, the ToDo-list for 15 selected months would be 15 times larger than for a single month. But you can use the CLUSTER function in your query filter and reduce the number of selected keys for the time dimension. The CLUSTER function replaces selection by their parent, if all of its children are selected. E.g. if you select a whole year, the function will replace the months by their parent year key.</li>
<li><strong>Use offline cubes</strong>: Since version 2.5, there is no need for any ToDo-List if every cube in the model is in the offline mode. Then, instantOLAP has to generate no SQL statements (and no ToDo-Lists) and every data will be loaded directly out of the offline stores.</li>
</ol>
	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li>No related posts.</li>
	</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.instantolap.com/howtos/query-too-complex/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
