Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

dynamic Bar chart for date range

hello experts,

Need solution on problem currently facing as I am new to Qlikview.

Fields are startdate, enddate, campaign name and average _sales

I want to plot a graph as average sales per day where sales date is in between start date and enddate for particular campaign.

I want to highlight the bars for each campaigns selected with duration of campaigns conducted(startdate and enddate).

I have successfully designed bar chart for average sales per day however no idea how to highlight the date range when campaign s getting selected.

Please help.

4 Replies
gauravkhare
Creator II
Creator II

Hi Tejaswini,

Let me tell you what we should be doing in this case. you have to take out the dite difference first that is the difference between the start date and end date. by taking out this difference we will then be able to make slabs.

Now we can perform this activity in two ways. Either you can make slab in the calculated dimension or you can write it in the scripting part itself.

again when you use in calculated dimension part it will slow down the chart performance so it will be better to make slab in the edit script part.

Now with this you have created a dimension field say datediff_sales. Now against this dimension you will be taking say sum(sales) as your expression...now go to color section and click on multicolor.

In this way your sales will be shown against their corresponding multicolored slab.

If any confusion still happens to presists then kindly send me your sample data and I will be making the graph for you

Not applicable
Author

Hello,

Thanks for your reply.

well I thought of calculating date difference. but I was wondering that will be tree like structure or values will get repeated.

for example.. If campaign abc istartdate is 1/2/2009 and enddate is 20/2/2009 then for abc campaign there will be 1st to 20th feb dates and so on chart. but on these dates abc is not the only campign that has beed conducted their can be any other campaigns also so these slabs will get override. How the hightlight part will work in that case.

Are you suggesting to populate date difference on script level is for essential? well will that be any function or some autogenerated dates?

I wont be able to share .qvw as I am using personal edition. I will try to send you date. thank you so much.

Regards,

Tejaswini

gauravkhare
Creator II
Creator II

As i said earlier populating the datedifference in the script level and then using it the front level will help in easy opeing of your charts..If you perform this calculation in the calculated dimension section it will slow up the chart performance. Kindly try out the above practice and you will be getting accurate results. Don't forget the check the box-'supress when the value is null'....well it depends on your data..!

Not applicable
Author

Hi Gaurav,

No luck in implementing your suggestions.

I have uploaded sample data as

[CONTENT DELETED per user request]