Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
ohenrichs
Contributor II
Contributor II

How to hide measure expression input in property panel

Hi, so I have a definition for measures:

 

measures: {
    uses: "measures",
    min: 0,
    max: measureCount,
    items: {
        numberFormatting: {
            show: false,
        },
    }
}

 

It hides their default numberFormatting property. How can I hide the expression property? I did not find it after searching an hour 😞

I tried 

 

expr: {
    show: false,
},
expression: {
    show: false,
},
Expression: {
    show: false,
},

 

nothing works. What does?

Labels (3)
1 Solution

Accepted Solutions
ohenrichs
Contributor II
Contributor II
Author

Thanks for the answer.

I actually also asked in Qlik's dev slack, someone had an idea that worked.

The item is called inlineMeasure

inlineMeasure: {
	show: false
},

This can also be expanded to only work for specific measures:

inlineMeasure: {
	show: (measure) => {
		// any rule you come up with
		return measure.props.YOURFIELD === "myDiscriminatingValue";
	}
},

 

View solution in original post

8 Replies
marksouzacosta
Partner - Specialist
Partner - Specialist

Hi @ohenrichs,

I'm not quite sure what are you trying to do but see if this helps somehow. It removes the Dimensions and Measures boxes from an Extension.

definition : properties,
initialProperties : {
	version: 1.0,
	qHyperCubeDef : {
		qDimensions : [],
		qMeasures : [],
		qInitialDataFetch : [{
			qWidth : 0,
			qHeight : 0
		}]
	},
	fontSize : {
		min : 8,
		max : 24
	}
},
Read more at Data Voyagers - datavoyagers.net
ohenrichs
Contributor II
Contributor II
Author

Hi Mark, 

thanks for the quick answer, I need to clarify. We auto-generate some measures for our extension, e.g.

Measure showing only Expression and LabelMeasure showing only Expression and Label

The code I posted above already removes the number-formatting. Now i want the Expression input to disappear, s.t. only the Label input is visible.

Best regards!

alex_colombo
Employee
Employee

Hey @ohenrichs , so you are creating measure and you want to hide the Expression input box? Why do you need this? I don't think this is possible. If you do not have the expression, there will not be any measure.

ohenrichs
Contributor II
Contributor II
Author

Hi Alex, 

we have an extension that, based on other options in the property panel, creates and manages some measures. Our extension's logic requires their expressions to not be edited. So we want to forbid the user doing that for these specific measures.

alex_colombo
Employee
Employee

I don't know a way for disabling the expression editor in a measure in chart properties panel. that part is designed for enable developers to insert expressions.

ohenrichs
Contributor II
Contributor II
Author

Does that mean that someone else might know or that disabling is impossible? In the latter case I guess I have a feature request 😅 

Thanks anyway for replying!

alex_colombo
Employee
Employee

One thing that you can do, is to hide the entire measure using the show property.
To my knowledge, there is no other way of doing what you are trying to do.

ohenrichs
Contributor II
Contributor II
Author

Thanks for the answer.

I actually also asked in Qlik's dev slack, someone had an idea that worked.

The item is called inlineMeasure

inlineMeasure: {
	show: false
},

This can also be expanded to only work for specific measures:

inlineMeasure: {
	show: (measure) => {
		// any rule you come up with
		return measure.props.YOURFIELD === "myDiscriminatingValue";
	}
},