Skip to content
This repository was archived by the owner on Sep 28, 2021. It is now read-only.

Only use the table names from "GetTableAndKeys" - #123

Merged
FredrikFolkesson merged 1 commit into
masterfrom
fix-sales-analysis-bug
Feb 11, 2019
Merged

FredrikFolkesson merged 1 commit into
masterfrom
fix-sales-analysis-bug

Conversation

@FredrikFolkesson

Copy link
Copy Markdown
Contributor

This fixes #122

Now you get the same tables that you get in Qlik Sense

There seems to be a mismatch between the tables that are included by using GetTableAndKeys and when using this hypercube

	object, _ := doc.CreateSessionObject(ctx, &enigma.GenericObjectProperties{
		Info: &enigma.NxInfo{
			Type: "my-pivot-hypercube",
		},
		HyperCubeDef: &enigma.HyperCubeDef{
			Dimensions: []*enigma.NxDimension{
				{
					Def: &enigma.NxInlineDimensionDef{
						FieldDefs:     []string{"=$Field"},
						SortCriterias: []*enigma.SortCriteria{{SortByExpression: -1, Expression: &enigma.ValueExpr{V: "=count($Table)"}}},
					},
				},
				{
					Def: &enigma.NxInlineDimensionDef{
						FieldDefs:     []string{"=$Table"},
						SortCriterias: []*enigma.SortCriteria{{SortByExpression: -1, Expression: &enigma.ValueExpr{V: "=count($Field)"}}},
					},
				},
			},
			Measures: []*enigma.NxMeasure{
				createMeasureSortNumeric("=sum($Rows)", &enigma.SortCriteria{SortByNumeric: -1}),
			},

			InitialDataFetch: []*enigma.NxPage{{
				Height: 1000,
				Width:  1000,
			}},
			Mode:         "P",
			NoOfLeftDims: &noOfLeftDims,
		},
	})

I think the later one returns a few system tables? that I think should not be included (if we want to include them we will have to handle this in another way so corectl does not crash when there is a system table that has no table record)

In the Sales_Anaylsis.qvf app it was the tables: _tabToday,Dimensions,Measures that was the problem.

@peol peol left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Perhaps double check with Björn H. that this is the intended behavior?

@wennmo wennmo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also add an integration test for the meta command? This change affects that command and it is currently not covered.

Otherwise it looks good to me 👍

@FredrikFolkesson
FredrikFolkesson merged commit 528cdfd into master Feb 11, 2019
@wennmo
wennmo deleted the fix-sales-analysis-bug branch February 11, 2019 12:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can not open app Sales_Anaylsis.qvf

3 participants

⌂ 换网址