Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join us at the Cloud Data and Analytics Tour! REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
jaryszek2
Creator
Creator

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
MVP & Luminary
MVP & Luminary

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

- Marcus

jaryszek2
Creator
Creator
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.