If I understand what you are asking correctly you should be able to achieve what you are after by using GetCurrentField([Drill Group]) on your Drill dimension and embedding that into your colour expression.
You will end up with quite a chunky expression with a number of nested if, just be careful with brackets and put in carriage returns to make the code readable.
If I have missed the point please post back and provide further details.
I tried what u suggest but didnt work.
I'll try to explain my problem in a different way:
I have a group with 3 dimension
Dimension 1 - Customer;
Dimension 2 - Region;
Dimension 3 - Variable 3
Imagine that i program Sum (sales ) in the expression.
In the background colour i program: if ( region='Lisbon'; rgb (0,0,0) , if (region='Porto', rgb (1,1,1) )).
Then Lisbon and Porto have a pre-selected colour.
But when i pre-select that colour to the regions name, automatically it give a fix colour to all customer names and variable 3 names.
What i want is to right a syntax that says something like that:
If is a region name than the colour will be pre-selected, but if is a customer name it gives mix colours automacally.
What i didnt want to do is this:
if ( region='Lisbon'; rgb (0,0,0) , if (region='Porto', rgb (1,1,1) , if ( customer=a, rgb (2, 2, 2 ) ).
What i would like is:
if ( region='Lisbon'; rgb (0,0,0) , if (region='Porto', rgb (1,1,1) , Mix colour for customer and variables 3 ).
Can u help me with that?
Thanks for the support.
I had add a file in qvw..
Hope this time you can understand my problem.
Test.qvw 733.5 K
The reason that you can not have multicoloured bars for dimensions 1 and 2 is that you have a combo chart with more than one dimension. Where this is the case QlikView uses one colour for the first dimension and another for the second.
You could remove the line from the chart and set the default colour (ie. when no region is matched) to null() and you would be able to tick Multicolored on the Colors tab and all would be as you wish.
With the combo chart though it is a little trickier, but I think you can achieve what you want by using the colour function. This allows you to reference the colours from the palette in code. As both the Ano and Med dimensions are numeric you can use this to your advantage to mix up the colours. Simply replace the default colour with the following:
color(if(GetPossibleCount(Ano) > 1, (Ano - 2000), max(id_mes) ) )
I've attached your document with the colour function amended accordingly.
Incidentally, as a rule of thumb I tend not to use multi coloured bars on bar charts unless there is a specific reason to do so.
Also, the data model in your document doesn't seem particularly well optimised. I would suggest reading up on data design best practice (I did a blog post entitled 'Getting the best performance from QlikView' - for instance) as this could save you from problems down the line.
All the best,
Multicoloured.qvw 733.5 K
Sorry to bother again, but i need i litle help.
Im making a report about a questionnaire.
The database is filed like that:
Id , Question 1-A, question 1-B, question 1-C, question 1-D
1, A, B, C , D
2, B, A, C, D
3, D, A, C, E
400, D, A, B, A
Then i want to make a table or a grah like this:
Rows\Columns A B C D E Total
Question 1-A 30% 20% 10% 5% 35% 400
I tryied in the dimension to Aggregate (question 1-A, Question 1-B, Question 1-C, Question 1-D)
Then i wrote in the 1st expression i count(Question 1-A ) ;
2nd expression count (question 1-b), etc.
The result isn't i pretend because it doesnt give me all the answers that is possible.
I attacht i file to see if u could help me.
Thanks a lot,
teste.qvw 387.5 K
I would recommend posting this into a new thread, as this one is marked as resolved and will not be looked at by people looking to provide solutions.
From the quick look I have had at the document I would say that you should use a cross tab on the data so all your responses are in a single column with another column that provides the detail of what question the answer relates to.
There are plenty of examples of the CrossTab statement in the manual and in the community.
Good luck with finding a solution.