Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
i am using 8.0 version of qlikview .
in that i want to make selections in one sheet but should not be reflected in other sheet ,
but if i come back to the previous sheet selection should be as it is .
Please ,help me
Hi
The only way to do this that I know of is to create a macro that is called on leaving Sheet1, this macro will copy the contents of selections into variables. The same macro should clear the selections for all of those variables.
Then, on activating Sheet1 (i.e. when returning to Sheet1) you should have a macro that takes the contents of the variables and make these the selections for the relevant fields.
It is certainly possible to do it (I do this quite often between different objects on the same sheet), but the details will depend on your fields and the selections made (do they have multiple selections).
Regards,
Hi,
Are you using one load statement for both sheets?. If yes then you can split the load statement into two.
Thanks
Saran.
Thanks for your reply,
yes it is one load statement for both sheets. But i want both the sheets having single load but selection should not be refrected in other sheet
i used micro ActiveDocument.clearall it works when i go to other sheet but when come back to first sheet selection also gets clear but i want that
selection as selected .......
Hi
The only way to do this that I know of is to create a macro that is called on leaving Sheet1, this macro will copy the contents of selections into variables. The same macro should clear the selections for all of those variables.
Then, on activating Sheet1 (i.e. when returning to Sheet1) you should have a macro that takes the contents of the variables and make these the selections for the relevant fields.
It is certainly possible to do it (I do this quite often between different objects on the same sheet), but the details will depend on your fields and the selections made (do they have multiple selections).
Regards,
Thank you
..or instead of useing variables you can use bookmarks.
Leaving Sheet A = macro save bookmark A
Entering Sheet B = macro open bookmark B
and the other way around. Saves alot of time spent on creating variables for everything.
setBookMark() //set a bookmark
recallBookUserBookmark() //recall a bookmark, if any
Thanks a lot !
Hi!
I am a relative novice to QV but am trying to create charts with preselected values. Some of our executive users want to be able to select a chart with values already in place. We are creating something of a menu for them to chose from. For example - Customer Sales for Region 1, Customer Sales for Region 2. They do not want to have to select the region from a select box.
This post seems to point to a similar situation but at the sheet level. Is there a way to do what I am trying to do???
Thanks for any and all help!
Robin Manzo
There are a couple ways that I've used. First, you can use set analysis. For example:
sum({<"Region"={'Region 1'}>} "Customer Sales")
That will, for that one expression in that one chart only, override their selections for Region, replacing it with 'Region 1'. That might be the easiest way. But if you really want to make the selections for them, you can do that with macros as well. Here is an example from one of my applications. I have a field "Report" that lists the various reports they can select. One and only one report can be selected. Each report checks for the selected value to decide whether to display or not. And OnSelect or OnChange of that field, I kick off the following macro to make selections, and in some cases, enable or disable expressions in the chart.
'-----------------------------------------------------------------------------------------------
'--------------------------- CANNED REPORTS ----------------------------------------------------
'-----------------------------------------------------------------------------------------------
sub selectCannedReport
report = ActiveDocument.getField("Report").getSelectedValues.Item(0).Text
'clear all selections
ActiveDocument.clearAll true
pos = instr(report," by Gauge & Width") - 1
if pos > 1 then
'--------------------------- BY GAUGE & WIDTH --------------------------------------------------
ActiveDocument.fields("Coating Group").select "Regular Galv"
ActiveDocument.fields("Selections Refer to The").select "Invoiced Coil (Current Coil if Uninvoiced)"
ActiveDocument.fields("Invoiced?").select "Y"
ActiveDocument.fields("Show Costs In").select "$/ton"
set selected = ActiveDocument.fields("This Month").getPossibleValues
ActiveDocument.fields("Month").selectValues selected
ActiveDocument.fields("Display Month").selectValues selected
set chart = ActiveDocument.getSheetObject("CH18")
set chartProperties = chart.GetProperties
set chartExpressions = chartProperties.Expressions
chartExpressions.Item(0).Item(0).Data.ExpressionData.Enable = false
chartExpressions.Item(1).Item(0).Data.ExpressionData.Enable = false
chartExpressions.Item(2).Item(0).Data.ExpressionData.Enable = false
chartExpressions.Item(3).Item(0).Data.ExpressionData.Enable = false
end if
select case report
case "Conversion Cost by Gauge & Width"
chartExpressions.Item(0).Item(0).Data.ExpressionData.Enable = true
chart.SetProperties chartProperties
case "Current Tons by Gauge & Width"
chartExpressions.Item(1).Item(0).Data.ExpressionData.Enable = true
chart.SetProperties chartProperties
case "Gross Proceeds by Gauge & Width"
chartExpressions.Item(2).Item(0).Data.ExpressionData.Enable = true
chart.SetProperties chartProperties
case "MOV by Gauge & Width"
chartExpressions.Item(3).Item(0).Data.ExpressionData.Enable = true
chart.SetProperties chartProperties
'--------------------------- MOV DATA BY MONTH -------------------------------------------------
case "MOV Data by Month"
ActiveDocument.fields("Selections Refer to The").select "Invoiced Coil (Current Coil if Uninvoiced)"
ActiveDocument.fields("Invoiced?").select "Y"
ActiveDocument.fields("Show Costs In").select "$/ton"
set selected = ActiveDocument.fields("This Year").getPossibleValues
ActiveDocument.fields("Year").selectValues selected
ActiveDocument.fields("Display Year").selectValues selected
'--------------------------- MOV DATA BY INDUSTRY & CUSTOMER -----------------------------------
case "MOV Data by Industry & Customer"
ActiveDocument.fields("Selections Refer to The").select "Invoiced Coil (Current Coil if Uninvoiced)"
ActiveDocument.fields("Invoiced?").select "Y"
ActiveDocument.fields("Show Costs In").select "$/ton"
set selected = ActiveDocument.fields("This Quarter").getPossibleValues
ActiveDocument.fields("Quarter").selectValues selected
ActiveDocument.fields("Display Quarter").selectValues selected
'--------------------------- MOV DATA BY REGION & CUSTOMER -------------------------------------
case "MOV Data by Region & Customer"
ActiveDocument.fields("Selections Refer to The").select "Invoiced Coil (Current Coil if Uninvoiced)"
ActiveDocument.fields("Invoiced?").select "Y"
ActiveDocument.fields("Show Costs In").select "$/ton"
set selected = ActiveDocument.fields("This Year").getPossibleValues
ActiveDocument.fields("Year").selectValues selected
ActiveDocument.fields("Display Year").selectValues selected
'--------------------------- PRICING BY CUSTOMER & PRODUCT -------------------------------------
case "Pricing by Customer & Product"
ActiveDocument.fields("Selections Refer to The").select "Invoiced Coil (Current Coil if Uninvoiced)"
ActiveDocument.fields("Invoiced?").select "Y"
ActiveDocument.fields("Sheet / Tin").select "Tin"
ActiveDocument.fields("Show Costs In").select "$/BB"
set selected = ActiveDocument.fields("This Year").getPossibleValues
ActiveDocument.fields("Year").selectValues selected
ActiveDocument.fields("Display Year").selectValues selected
end select
end sub
Thank you for your response. Your "canned reports" concept sounds exactly like the direction in which we are heading and I will try to follow your example in a macro.
Robin