Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Qlikcommunity,
I am trying to represent a Mysql table as an histogram in qlikview.
The table has many columns but i am focusing on 3 of them:
- costs
- units
- risk level
In my qlikview document , I have the 2 dimensions:
- unit(CODEU)
- risk level(RISKREVSTAT)
I am also using a sum() function on a specific column of the table (for example costs).
"Risk level" is another column of the same table
My purpose is to do a stack histogram to represent the costs(sum of the costs) according to the risk level respecting specific color rules:
To summarize, i want qlilview to do:
- the sum by dimension unit of all rows having risk level=low, risk level=medium,.....
- display the color stacks using specific color rules(low=GREEN, high=RED, medium=YELLOW, empty=GREY)
I hope i have been clear in my exmplanation, thank you in advance for your help
Regards
Hi,
Please find the attached screen shot for changing the expressions color from Chart properties. You can checked the persisent color check box option which locks the color map so that each value has a color permanently assigned to it.
Hope this help,
Anosh Nathaniel
Hi,
You can write expression for backgroud color in expression tab in which you can specify the color for each value.
Please post a sample data/QVW file to make your problem more clear.
Hope this help,
Anosh
Hi Anosh,
thanks for your reply, please find attached a snashot of my Qlikview report.
As u can see, the color displayed is not corresponding to the 'risk level' at the right.
Regards
Hi,
Please find the attached screen shot for changing the expressions color from Chart properties. You can checked the persisent color check box option which locks the color map so that each value has a color permanently assigned to it.
Hope this help,
Anosh Nathaniel
thank you a lot Anosh, it resolved my problem.
But i heard there is another way to perform that using color functions. Is it right? If yes, how can i implement the same using function?
Thank you in advance
Hi Anosh,
I am coming back again just for one more question:
How can i order my charts colors as specified below ??:
- LOW (green) at the the bottom
- MEDIUM (yellow) second part of the chart
- HIGH (red) upper part of the chart
thank you in advance for your help
Hi,
Order your expressions in such a way that green should be first, yellow should be second and red shold be third and then change the color in colors tab accordingly.
Hope this help,
Anosh Nathaniel
Hi anosh,
The chart is stacked according a dimension called "risklevel" witch has 4 values (low, medium, high, undefined).
I mapped 4 colors to these 4 values (grey, green, red, yellow), the system automatically (alphabetically) sorted the values in this order: grey, green, red, yellow.
How can i sort the colors according to my needs , so qlikview will display following the rule below:
grey, green, yellow and red (the highest risk level!). ??
thank you in advance
In these case I always add an numberfield to my script ,on which I can sort.
In your case it would be something like:
Join (YourTable)
LOAD * INLINE [
SORT, RISKREVSTAT
1, Grey
2, Green
3, Yellow
4, Red
];
This will add a field (SORT) to your table which you can use as a sort by expression in your sort tab.
In your case you might even be able to use "Sort by Load Order"