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

Bulk add conditions to columns?

Hi, 

I'm building a table that will only show a particular column based on a condition. See in the attached example the column 'Customer' only displays if 'Logo' appears somewhere  in the 'Product' column (figs. 1 & 2)

My problem is that I need to put conditions on ~350 columns.  Is there some way I can bulk load these conditions? I can create them in excel but copy-pasting through the UI is going to drive me bananas.

Any insight much appreciated.

Stephen

Labels (1)
2 Solutions

Accepted Solutions
swearengen
Contributor III
Contributor III
Author

Thanks for the help Vitali. Found what I was looking for after you pointed me in the right direction. Thanks to fosuzuki for the particulars

Sub ExpressionEnableCondition

set chart=ActiveDocument.GetSheetObject("CH25")

set cp=chart.GetProperties

set dims=cp.Dimensions

set expr=cp.Expressions.Item(0).Item(0).Data.ExpressionData

dims(0).Show.Type=2 '2=cond

dims(0).Show.Expression="sum(a)<10000"

chart.SetProperties cp

End Sub

View solution in original post

vchuprina
Specialist
Specialist

Great! I've found a similar thing a few minutes ago

SUB AddConditionalExpressionToExistingChart

set chart = ActiveDocument.GetSheetObject("CH01")
ExpNo = chart.AddExpression( "sum([Delivered Quantity])")

set cp = chart.GetProperties
set ExpVis = cp.Expressions.Item(ExpNo).Item(0).Data.ExpressionVisual

ExpVis.Label.v = "Delivered Quantity"
ExpVis.NumAdjust = 1 'center
ExpVis.LabelAdjust = 1 'center

set ExpCond= cp.Expressions.Item(ExpNo).Item(0).Data.EnableCondition

ExpCond.Type = 2
ExpCond.Expression = "sum( [Delivered Quantity] ) > 0"

chart.SetProperties cp

END SUB

Press LIKE if the given solution helps to solve the problem.
If it's possible please mark correct answers as "solutions" (you can mark up to 3 "solutions").

View solution in original post

6 Replies
vchuprina
Specialist
Specialist

Hi,

You can try to use Dev menu in qliksense

https://www.youtube.com/watch?v=9lhL3Nrel5Q

https://community.qlik.com/t5/Qlik-Design-Blog/Developer-menu-in-Qlik-Sense-client/ba-p/1471915

Regards,

Vitaii

Press LIKE if the given solution helps to solve the problem.
If it's possible please mark correct answers as "solutions" (you can mark up to 3 "solutions").
swearengen
Contributor III
Contributor III
Author

Hey Vitali thanks for the tip but I should have mentioned I'm using Qlikview.

vchuprina
Specialist
Specialist

In Qlikview, it should be possible to do with the VBScript macro.

I will try to find something similar to your needs.

Press LIKE if the given solution helps to solve the problem.
If it's possible please mark correct answers as "solutions" (you can mark up to 3 "solutions").
swearengen
Contributor III
Contributor III
Author

Great thanks.

swearengen
Contributor III
Contributor III
Author

Thanks for the help Vitali. Found what I was looking for after you pointed me in the right direction. Thanks to fosuzuki for the particulars

Sub ExpressionEnableCondition

set chart=ActiveDocument.GetSheetObject("CH25")

set cp=chart.GetProperties

set dims=cp.Dimensions

set expr=cp.Expressions.Item(0).Item(0).Data.ExpressionData

dims(0).Show.Type=2 '2=cond

dims(0).Show.Expression="sum(a)<10000"

chart.SetProperties cp

End Sub

vchuprina
Specialist
Specialist

Great! I've found a similar thing a few minutes ago

SUB AddConditionalExpressionToExistingChart

set chart = ActiveDocument.GetSheetObject("CH01")
ExpNo = chart.AddExpression( "sum([Delivered Quantity])")

set cp = chart.GetProperties
set ExpVis = cp.Expressions.Item(ExpNo).Item(0).Data.ExpressionVisual

ExpVis.Label.v = "Delivered Quantity"
ExpVis.NumAdjust = 1 'center
ExpVis.LabelAdjust = 1 'center

set ExpCond= cp.Expressions.Item(ExpNo).Item(0).Data.EnableCondition

ExpCond.Type = 2
ExpCond.Expression = "sum( [Delivered Quantity] ) > 0"

chart.SetProperties cp

END SUB

Press LIKE if the given solution helps to solve the problem.
If it's possible please mark correct answers as "solutions" (you can mark up to 3 "solutions").