Search code examples
iccube

Drillthrough to underlying text data in icCube?


How to set-up a model in icCube to allow to drill down to the details, when details contain text fields?

The idea is to get a list, with column names containing the text fields (in combination with amount fields). Just like a simple SQL statement would give.

I have tried the following:

  • a) added a technical dimension that is linked to the rows (via rownumber) and added MIN Aggregation for the text fields. With the idea to use these when a DRILLTHROUGH MDX statement is invoked. The DRILLTHROUGH function works, but does not give the values next to each other for the measures. Result is like: enter image description here

  • b) added each unique line a line number and loaded the line number as lowest detail in one of the dimensions. Added attributes for these text and date items for the "drillthrough" columns. Next, added calculated measures to get the property for these attributes. The drillthrough is now effectively a drillby to the lowest details. It works, but this is not nice as it blows up my dimension.

  • c) tried to use the widget data source SQL, but it is not available for text files, and it does not work for MSAccess files (too slow).

The preferable solution should works in the dashboards and in any XMLA/REST API interface.

Enclosed this example

the schema file

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<schemaFactory revisionNumber="7">
    <schemaDefinition name="drilltrhough-text" description="" group="Issues" loadOnStartup="false">
        <activateIncrementalLoad>false</activateIncrementalLoad>
        <useUnknownMembersInFacts>true</useUnknownMembersInFacts>
        <autoCleanUpTableColumns>false</autoCleanUpTableColumns>
        <useFactPartitioning>false</useFactPartitioning>
        <callGarbageCollector>NONE</callGarbageCollector>
        <backup>NONE</backup>
        <nonEmptyCachePolicy>NONE</nonEmptyCachePolicy>
        <nonEmptyCacheType>REGULAR</nonEmptyCacheType>
        <nonEmptyCachePersistency>MEMORY</nonEmptyCachePersistency>
        <storagePolicy>DEFAULT</storagePolicy>
        <hierarchyUniqueNameStyle>IncludeDimensionName</hierarchyUniqueNameStyle>
        <inMemoryDS name="data">
            <memoryDataTable tableName="data" rowLimit="-1" id="d9429713-9be8-4c63-9b40-4a20388e7563">
                <column name="dimension" tableType="STRING" type="STRING" selected="true" primaryKey="false"/>
                <column name="amount" tableType="STRING" type="STRING" selected="true" primaryKey="false"/>
                <column name="text" tableType="STRING" type="STRING" selected="true" primaryKey="false"/>
                <addRowNumber>false</addRowNumber>
                <stringDateConverter></stringDateConverter>
                <trimStrings>true</trimStrings>
                <columnSeparator>,</columnSeparator>
                <commentMarker>#</commentMarker>
                <dataAsString>dimension, amount, text
a, 10,some text
b, 20, some more text
c, ,text without an amount</dataAsString>
            </memoryDataTable>
        </inMemoryDS>
        <multiLevelDimension dataTableId="d9429713-9be8-4c63-9b40-4a20388e7563" isTimeDimension="false" isDefaultTimeDimension="false" isIndexingByRange="false" id="86d118f0-71ba-4826-a6ac-343eac96fb05" name="Dimension">
            <multiLevelHierarchy hasAllLevel="true" allLevelName="All-Level" allMemberName="All" name="Dimension" isDefault="true">
                <level name="Dimension - L" nameUnique="false" nameUniqueInParent="false" keyUnique="false" ignoreNameCollision="false">
                    <nameCol name="dimension"/>
                    <orderType>BY_NAME</orderType>
                    <orderKind>ASC</orderKind>
                </level>
            </multiLevelHierarchy>
        </multiLevelDimension>
        <cube id="caa9c520-f953-4c77-9e72-76c8668170f7" name="Cube">
            <defaultFacts measureGroupName="Facts" partitioningLevelName="" partitioningType="NONE" newGeneration="true" dataTableId="d9429713-9be8-4c63-9b40-4a20388e7563" aggregateDataSourceFacts="false" unresolvedRowsBehavior="ERROR">
                <rowFactAggregationType>ADD_ROW</rowFactAggregationType>
                <measure name="Amount" aggregationType="SUM">
                    <dataColumn name="amount"/>
                </measure>
                <measure name="Text" aggregationType="MIN">
                    <dataColumn name="text"/>
                </measure>
                <links dimensionId="86d118f0-71ba-4826-a6ac-343eac96fb05">
                    <viewLinks type="LAST_LEVEL">
                        <toColumns name="dimension"/>
                    </viewLinks>
                </links>
            </defaultFacts>
        </cube>
    </schemaDefinition>
</schemaFactory>

- the mdx

drillthrough
select [Measures].members on 0
, [Dimension].[Dimension].[Dimension - L] on 1
from [cube]
return Name([Dimension])
  • the result

enter image description here


Solution

  • This is not related to having a measure of type STRING.

    You're performing a multi-cell result drillthrough (which is an extension of standard MDX in icCube). In that case, the result is "organized" per result cell meaning each [Measures] being in its own category (you can add another Amount measure and you'll see the same behavior).

    Instead you should perform a single cell drillthrough:

    drillthrough 
      select [Dimension].[Dimension].[Dimension -L].[a] on 0     
      from [cube]
    

    And the result should look like:

    enter image description here

    You can see the [Measures].[Info] being on the same row (as all the other measures).

    Hope that helps.