Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
danelooman
Creator
Creator

Adding "Show Column If" condition when creating table viz on the fly.

I am importing a csv file to create a table based on the matching dimensions/measures and an if statement. I would like the if statement to populate in the "Show Column If" in the table. I am using the capability API to do this but I am open to using enigma as well. Below is an example of what I am trying. I have tried the calcCond property which is what I think it is supposed to reference.  Edit: Just to be clear, I can get it to conditionally show and hide from these but it is not populating the "Show Column If" property for the table in the properties panel. This means no one can edit it in the future. 

 

app.visualization.create('table', [
{
        qLibraryId: metric.MasterItemID,
	qType: 'dimension',
	qNullSuppression: true,
	qOtherTotalSpec: {
		qOtherMode: 'OTHER_OFF',
		qSuppressOther: true,
		qOtherSortMode: 'OTHER_SORT_DESCENDING',
		qOtherCounted: {
			qv: '5',
			},
		qOtherLimitMode: 'OTHER_GE_LIMIT',
	},
	qCalcCond: {
	        qv: '1=1',
	},
	qCalcCondition: {
		qCalcCond: {
			qv: '1=1',
		},
	},
}]

 

 

Labels (3)
1 Solution

Accepted Solutions
danelooman
Creator
Creator
Author

In classic forum fashion,  I figured it out right after posting this. The qCalcCondition is what is needed but it needs to be formatted differently.  I also had to move the qType to the end.

{
qLibraryId: metric.MasterItemID,
qNullSuppression: true,
qOtherTotalSpec: {
	qOtherMode: 'OTHER_OFF',
	qSuppressOther: true,
	qOtherSortMode: 'OTHER_SORT_DESCENDING',
	qOtherCounted: {
		qv: '5',
	},
	qOtherLimitMode: 'OTHER_GE_LIMIT',
},
qCalcCondition: {
	qCond: {
		qv: "1=1",
	},
	qMsg: {
		qv: '',
	},
},
qType: 'dimension',
};

  

View solution in original post

2 Replies
danelooman
Creator
Creator
Author

In classic forum fashion,  I figured it out right after posting this. The qCalcCondition is what is needed but it needs to be formatted differently.  I also had to move the qType to the end.

{
qLibraryId: metric.MasterItemID,
qNullSuppression: true,
qOtherTotalSpec: {
	qOtherMode: 'OTHER_OFF',
	qSuppressOther: true,
	qOtherSortMode: 'OTHER_SORT_DESCENDING',
	qOtherCounted: {
		qv: '5',
	},
	qOtherLimitMode: 'OTHER_GE_LIMIT',
},
qCalcCondition: {
	qCond: {
		qv: "1=1",
	},
	qMsg: {
		qv: '',
	},
},
qType: 'dimension',
};

  

mattias-thalen
Contributor II
Contributor II

Thank you, I was just having the same issue.

FYI, I could enter it with less code:

qCalcCondition: { qCond: "=1" }

 

Now, I need to know how to do it to the object, so that Add-ons > Data handling > Calculation condition populates.