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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

bar line chart problem

Hello,

I'm trying to create a graph that will show sales for each week for the past 3 weeks + current week.

Basically this needs to looks like this:

I tried two approaches to do this graph.

I created a bar chart with selected 'values on data points' and I made bars invisible. I can't seem to find a way to connect those data points. If I would be able to connect the data points then this graph would be finished.

Then I made a line chart, and for this I played around with calculated dimension with no luck as I'm not very good at qlikview syntax.

Can somebody help/guide me to solve this? Thanks

Labels (1)
3 Replies
Not applicable
Author

I took a look at your sample and I think you are overcomplicating it, but maybe I am missing something. Do you want the past 4 weekends to be based on a selection or the max weekend in your data set? I assumed you wanted it based on the max (selection based is a bit different, but possible).

I got rid of your calculated dimension and expression. I set Weekday as the dimension and for the expression, used:

sum({<Weekend={'>=$(=Max({1}Weekend, 4))'}>}Amount)


That will respect selections, but will only display the four most recent Weekday values. I've attached a sample.

Not applicable
Author

Hello,

Thanks for your feedback.

I want the past 4 weekends to be based on selection.

Thanks

Not applicable
Author

Well, that makes it a little more difficult. First, you're going to have to determine what to do if multiple months are selected or if no months are selected. You can force a month to be selected by checking the Always One Selected Value on the List Box. For multiple selections, there are multiple options. You can use the max selected or use a macro to change the selection. I posted an example of using a macro to change multiple selections to one on the forum a while back.

Once you have one selected value in the field, you can use:

sum(
{<Weekend={'>=$(=Date(GetFieldSelections(Weekend) - 28))
<=$(=Date(GetFieldSelections(Weekend)+1))'}>}
Amount)


I've attached a sample.