Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
rodri_morales
Creator II
Creator II

Change Dimension

I have a doubt, can I use a Combo Box to change de dimension of a bar chart? Can anyone explain me how to do it?

18 Replies
rodri_morales
Creator II
Creator II
Author

I create the Input Box and do what you said.. but when you say "Use this variable in your chart dimension..", what variable are you talking?

stigchel
Partner - Master
Partner - Master

I have no idea what you are trying to do, all I can see is you have included my suggested script within an other load script, it should be a separate load.

Either upload a sample of your document, or I'm unable to help you any further...

rodri_morales
Creator II
Creator II
Author

Here are images:

script.png

error.png

stigchel
Partner - Master
Partner - Master

From what I can see in the picture this piece of script is placed after a preceding load?? Place the inline load before the previous load statement.

stigchel
Partner - Master
Partner - Master

See my attached example of what I mean

rodri_morales
Creator II
Creator II
Author

It works correctly Piet, than you for your time! I appreciate... Another doubt, the chart start with no value, when I click on one, the chart work correctly. Can I put a default value, so the chart start showing Problem or Area?

stigchel
Partner - Master
Partner - Master

Yes you can, as suggested earlier, mark the "Always one selected" option for this field:

- Put a listbox on your sheet with the DimLabel field

- Select one value in this listbox

- In properties\general tab of this listbox mark always one selected

After you have done this you can remove the listbox, it is a field setting, so qv will 'remember' this option

I've also done this in the sample.qvw I attached earlier (just add the listbox DimLabel to see)

rodri_morales
Creator II
Creator II
Author

Can I apply the same to a calculate expresion? I want to:

sum(if(EsCanje=0, amount))

sum(if(EsCanje=1, amount))

I try to do it, but I dont know how to write the calculate expresion.

stigchel
Partner - Master
Partner - Master

The syntax is correct for an expression (provided that EsCanje and amount are correct field names (including caption)).

However, EsCanje should either always have one value or should be part of the dimensions.

If you add EsCanje to the dimensions, you do not need the if--> sum(amount)  is enough

Otherwise use an aggegrate --> Aggr(sum(if(EsCanje=0,amount)),EsCanje)