Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
In Qlik Sense, I have a bar chart in which i have one dimension and two measures. I want to give colors of my choice for each measure.
Also i am using a valuelist function to generate dimension values.
Please suggest .
It was very easy to achieve the same in QlikView, but seems its not directly possile in Sense.
Thanks
I guess I got your problem,
Uncheck show zero values from Addons section.
PFA
Maybe this will help:
Qlik Sense: How to set custom colors by measure in a bar chart
Use valuelist() for Measures also.
And in color by expression use same valuelist to give color of your choice
I just did this yesterday.
Set up an additional dimension based on ValueList of your choices.
ValueList('Start of Care','End of Care')
Then use the same ValueList in your Measure Expression.
if(ValueList('Start of Care','End of Care')='Start of Care'
,Avg(MeasureValueStart)
,if(ValueList('Start of Care','End of Care')='End of Care'
,Avg(MeasureValueEnd))
)
Then set color to expression and use something like this:
if(ValueList('Start of Care','End of Care')='Start of Care',rgb(245,122,43),rgb(252,175,24) )
Hi Mark,
I tried this earlier but the problem is I am using MonthYear in the Dimension and want to see only last 6 month bars.
I am using below expression in the measure.
Count({<Date={">=$(=addmonths(max(Date),-6))"}>} DISTINCT Loan_Ref_No)
When i am using your approach, it shows all the 12 months and 6 months has not data.
I have unchecked the "Show null values". Thesre is no option to suppress 0 .
Please suggest.
Thanks,
Chetan Sehgal
Hi Chetann,
Suggestion given by Mark works perfectly. Because I always use this approach.
when you are using valuelist(), what is the exression you are using in chart?
Hi Shraddha,
The solution works fine. But i am getting addition problem . I want 6 months data only for which i have written set exprssion in measure and it works if i am using only one dimension i.e month. If i add valuelist as new dimension, immediately 6 empty months are getting added in chart.
Thanks,
Chetan
can you share your sample.
because it works with timeline in my case
Dimension: Month Year (Sep 2016, Aug 2016......)
Expression 1 : Sum(Sales)
Expression 2: Sum(Discount)
I want only last 6 month bars in the chart.
i.e if i have data upto Sep 2016, then it should show Sep 2016,Aug2016,Jul 2016,Jun 2016, May 2016, Apr 2016
I dont have MonthNumber as any field in data and i cant change data as well.
I am using Date={">=$(=addmonths(max(Date),-6))"} in both the expressions to show 6 months only.
Then it will be
Dimension 1 : Month Year (Sep 2016, Aug 2016......)
Dimension 2: Valuelist('Sales','Discount')
Measure:
pick(Wildmatch(Valuelist('Sales','Discount'),'Sales','Discount'),
Sum({<Date={">=$(=addmonths(max(Date),-6))"}>}Sales),
Sum({<Date={">=$(=addmonths(max(Date),-6))"}>}Discount)
)
Color by expression:
pick(Wildmatch(Valuelist('Sales','Discount'),'Sales','Discount'),
red(),
green()
)
(Change colors according to your requirement)
Let me know whether it works