Skip to content

Commit

Permalink
Updated logic to show and hide dimensions
Browse files Browse the repository at this point in the history
  • Loading branch information
rileymd88 committed Apr 3, 2020
1 parent edbe50e commit f4e11cc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ If you want to do code changes to the extension follow these simple steps to get
3. Run `npm install`
4. Run `npm run build` - to build a dev-version to the /dist folder.

## Release Notes v0.5
* Updated logic to show and hide dimensions

## Release Notes v0.4.1
* Updated node packages

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "qwik-table",
"version": "0.0.1",
"description": "An easy way to create a standard customised table in Qlik Sense",
"version": "0.5",
"description": "An easy way to create a standard customized table in Qlik Sense",
"homepage": "https://github.com/rileymd88/qwik-table",
"repository": "https://github.com/rileymd88/qwik-table",
"author": "Riley MacDonald",
Expand Down
8 changes: 4 additions & 4 deletions src/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -376,13 +376,13 @@ export default ['$scope', '$element', function ($scope, $element) {
// Transform table props into new flexible table
let newTableProps = JSON.parse(JSON.stringify(tableProps));
for (let dc = 0; dc < newTableProps.qHyperCubeDef.qDimensions.length; dc++) {
newTableProps.qHyperCubeDef.qDimensions[dc].qCalcCondition.qCond.qv = `=SubStringCount(Concat([${$scope.dimName}ID], '|'), '${dimensionLabels[dc].id}')`;
newTableProps.qHyperCubeDef.qDimensions[dc].qCalcCondition.qCond.qv = `=SubStringCount(Concat([${$scope.dimName}ID], '|'), '${dimensionLabels[dc].id}') and GetSelectedCount([${$scope.dimName}]) > 0`;
}
for (let mc = 0; mc < newTableProps.qHyperCubeDef.qMeasures.length; mc++) {
newTableProps.qHyperCubeDef.qMeasures[mc].qCalcCondition.qCond.qv = `=SubStringCount(Concat([${$scope.mesName}ID], '|'), '${measureLabels[mc].id}')`;
newTableProps.qHyperCubeDef.qMeasures[mc].qCalcCondition.qCond.qv = `=SubStringCount(Concat([${$scope.mesName}ID], '|'), '${measureLabels[mc].id}') and GetSelectedCount([${$scope.mesName}]) > 0`;
}
newTableProps.qHyperCubeDef.qCalcCond = `GetSelectedCount([${$scope.dimName}]) > 0 and GetSelectedCount([${$scope.mesName}]) > 0`;
newTableProps.qHyperCubeDef.qCalcCondition.qCond.qv = `GetSelectedCount([${$scope.dimName}]) > 0 and GetSelectedCount([${$scope.mesName}]) > 0`;
newTableProps.qHyperCubeDef.qCalcCond = `GetSelectedCount([${$scope.dimName}]) > 0 or GetSelectedCount([${$scope.mesName}]) > 0`;
newTableProps.qHyperCubeDef.qCalcCondition.qCond.qv = `GetSelectedCount([${$scope.dimName}]) > 0 or GetSelectedCount([${$scope.mesName}]) > 0`;
newTableProps.qHyperCubeDef.qCalcCondition.qMsg.qv = "Please select your dimensions and measures";
newTableProps.qInfo.qId = $scope.layoutId;
newTableProps.qInfo.qType = 'table';
Expand Down

0 comments on commit f4e11cc

Please sign in to comment.