Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Can anybody help me with the following questions? Thanks upfront.
I tried to export an excel report with tab of fields of a list box. If I do it manually, it is like I select one value in list box and the real report will change with the list box. Then I export the Excel report. I will go though all the value in the list box.
I can use pass the variable into list box, but list box value will change with grey out which was not selected.
The expression in the list box is =If(PreferedField = GivenVariableValue, PreferedField) .
For example, if I give GivenVariableValue = Apple, the Apple will show in the list box display but not selected.
Can anyone help me with this issue please? Thanks again.
Have a look here: Export Multiple Chart Objects to Excel and Loop by Field
- Marcus
Hi, Marcus,
Thank you very much for your fast response and help. I can export a report into 8 different regions, but the region selected was not affect the report as a filter. Can I know if I did anything wrong?
Thanks a lot
Maybe this happens because there are set analysis expressions in use which are independent from region- selection, like: sum({< Region = >} value) or sum({< Region = {'*'}>} value) or sum({1} value). Also the use of alternate states could cause such behaviour and of course you need to use the right region-field in cases you have several different ones and also the region-field must be proper associated within your datamodel.
- Marcus
Thank you. Can I know if anyway it can work like a list box works? So I can select a region, and the selection will apply to all the chart.
The above mentioned methods of set analysis and alternate states are specialized approaches to break the normal associations between the fields related to whole datamodel. This could be very useful and has many advantages but of course there are disadvantages, too especially in this way that you need to take care to make clear what (didn't) happens by any selections and why.
To be more practically to your question - quite common and often the easiest way is the method of having separate objects for export and printing (maybe in a hidden sheet) which are specialized for only these purpose without (these) set analysis, alternate states and with different columns, layouts and so on. You will need to declare explicit which purpose and functionality each object has and use them appropriate.
- Marcus
Hi, Marcus,
I did change the set analysis of the calculation and using a variable to give the region value. But when I was using for each loop, putting value into variable one by one. It exported only one report. I assuming that is because the exporting process happened only one. Am I on the right direction? Thank you.
Dave
It could be that something in your routine didn't work like you exprected it. I suggest to use various msgbox to see if your loop runs really through all region-values, like:
msgbox YourLoopCounter
msgbox YourRegion 'field-value or variablen-value
- Marcus
Hi, Marcus,
Finally, I figure it out that I should pass the macro variable value into Qlikview variable. Then it will work. Thanks a lot.