Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Combo Charts

month.png

Hi all,

The bars show the defects per unit for each month, and the line shows the goal of how many defects per unit there should be for each month.  I only want the line to show if there is a bar, so for November and December, since there is no data yet, I do not want the goal to show.  When mid November comes and data is pulled and added as a bar in this chart, I'd then like the goal line to show.  Is there anyway to put an if statement around the goal line to only show when there is a bar, or something like that?

Thanks,

Channing

1 Solution

Accepted Solutions
mphekin12
Valued Contributor

Re: Combo Charts

Maybe try this for your Defects Per Unit Goal expression:

     if(defects per month > 0, defects per month goal, 0)

Also make sure 'Suppress Zero-Values' is selected.

Hope this helps!

5 Replies
mphekin12
Valued Contributor

Re: Combo Charts

Maybe try this for your Defects Per Unit Goal expression:

     if(defects per month > 0, defects per month goal, 0)

Also make sure 'Suppress Zero-Values' is selected.

Hope this helps!

prabhu0505
Valued Contributor

Re: Combo Charts

Assuming bar chart as first  and line as second expression in the chart.

If (sum(column(1))=0,'', 'Your second expression')

Attach sample dashboard if above solution doesn't work.

mphekin12
Valued Contributor

Re: Combo Charts

Channing,

Glad I could help with your issue.  I do have one question for you.  How did you make both the year and the month numbers (I am assuming they are the months of the current year) dimensions in the chart that is listed in the image above?

Thanks!

Not applicable

Re: Combo Charts

Hello!

So my data is structured as a star schema with a fact table linking all of the dimensions, as shown below.

calendar.png

The Calendar has basically any fields you could think of that relate to a date, as shown below.

cal.png

The calendar table has a YearMonthKey which is the year and month combined as shown above.

Then, linked to the calendar is a ChartTable which is shown below, which links to the calendar using the YearMonthKey. The xAxisDimension field is full of years and also months. If you keep scrolling down, you will see the YearMonthKey being, for example, 20123, and the xAxisDimension being 3.

xaxisdimension.png

When making a chart, my dimension is the xAxisDimension field. I made variables vCurrentYear which is 2015, vPriorYear for 2014, vPrior2Year which is 2013, and vPrior3Year which is 2012.  As you see below, I make an expression for each variable.  Below shows the current year expression, and for each of the DPU Prior Year and below I just change the variables. 

hiii.png

Please let me know if you have any other questions or if you need more explanation!

Channing

mphekin12

mphekin12
Valued Contributor

Re: Combo Charts

Channing,

Thanks for the explanation.  That is a really cool solution! 

Community Browser