Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
richard_pearce6
Luminary Alumni
Luminary Alumni

Custom Properties for Measures

Hi All,

Slight issue retrieving a custom property for a measure..... My Example property.js Code is:

 var measures =

   uses: "measures",

    min: 0,
    items: {
        MyCheckProp: {
          type: "string",
          label: "Background color expression",
          ref: "qAttributeExpressions.0.qExpression",
          component: "expression",
        },
        BoolExample: {
          type: "boolean",
          label: "Percentage?",
          ref: "qAttributeExpressions.1.qExpression",
          defaultValue: false
        }
    } };
 
The extension shows both custom properties in Edit mode in QS. When I check the hypercube results I can only find the first (MyCheckProp) here at layout.qHyperCube.qMeasureInfo[0].qAttrExprInfo[0]
 
The second custom property (BoolExample) can't be found in the hypercube  I can only assume ref: "qAttributeExpressions.1.qExpression"  is incorrect (as its not an expression) although I've not been able to track down a solution on the help file
 
Help gratefully received. R
 
Labels (2)
3 Replies
ErikWetterberg

Have you tried using component: ’expression’ ?

Might work, I haven’t tried. You might also need to set type to strong.

Manoj_Prabu
Partner - Creator
Partner - Creator

Hi @richard_pearce6 ,

In Qlik sense if you add any properties, then you have to cut the object and paste it again or delete the object and select dimension and measures from the beginning to show the qAttrExpr or qDef properly. 

Thank you.

ajaykakkar93
Specialist III
Specialist III

 

measures: {
				uses: "measures",
				min: 0,
				max: 30,
				items: {
					showIF:  {
						type: "string",
						label: "Show Column IF",
						ref: "qCalcCondition.qCond.qv", 
						component: "expression"
					},
					TotalAggr: {
						type: "string",
						label: "Total Function",
						ref: "qDef.qAggrFunc",
						component: "dropdown",
						options: [{
							value: "Expr",
							label: "Auto"
						},{
							value: "Avg",
							label: "Avg"
						}, {
							value: "Count",
							label: "Count"
						}, {
							value: "Min",
							label: "Min"
						}, {
							value: "Max",
							label: "Max"
						}, {
							value: "Sum",
							label: "Sum"
						},{
							value: "None",
							label: "None"
						}]
					},
					info: {
						label: "Add all the below as string(='color | bdcolor | textalign | header bgcolor | header color')",
						component: "text"
					},
					textcolor: {
						type: "string",
						ref: "qAttributeExpressions.0.qExpression",
						label: "Text Color",
						//expression: "always",
						component: "expression",
						defaultValue: "='#000'"
					},
					}}

 

 

I hope this helps you Or can refer to the file attached.
When you add a custom property I suggest to delete the object from the sheet and refresh the page, Add the object back again to look at changes.

Please mark the correct replies as Solution. Regards, ARK
Profile| GitHub|YouTube|Extension|Mashup|Qlik API|Qlik NPrinting