Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Macro selecting one value in one sheet and activating chart with expressions with second sheet

Hi,

I'm new here and have a problem with my macro:

// First of all, i'm giving the value throw the input box and select other sheet in my application

Sub ChooseValue

Set q = ActiveDocument

q.ClearAll (false)

Set f = q.Fields("Obiekt CO_nr")  

x = inputbox ("Enter product")

f.Select(x)

set s = q.Sheets("Analizator Typów Sprzedaży")

s.Activate

//now i have a problem:

I  want to run chart with ID "CH171" with this selected value but chart is activating only when button "Wn" is choosed (please see the image attached) - so only if condition (vWn and vPor_okresow=0) is fullfilled.

vWn = -SubStringCount (concat (PrzekrojeID,'|'),1)*(GetSelectedCount(Przekroje)>0)

vPor_okresow=0

How can i activate the chart? How can i enforce chart to show this one specific value?

I have already tried to use code below:

set v = ActiveDocument.Variables("vWn")

v.SetContent "1",true

But it doesnt work...

Thank you all for your support.

Best Regards

Jacek Antek

2 Replies
marcus_sommer

You set with "1" a string-value, try it without the quotes.

- Marcus

Anonymous
Not applicable
Author

Hi Marcus,

thank you for your answer!

I did this, problem was... different alternative state on the second sheet and macro couldnt work around this.

Best Regards,

Jacek Antek.