Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to display two Quarters data in bar chart

Hi all,

I am 10 days old to Qlikview and I have the below data::

Quarter Name

Start dateEnd dateQuantity
2014-Q42014-03-302014-06-281000
2014-Q32013-12-292014-03-29800
2014-Q22013-09-292013-12-28600

If I select 2014-Q4..I am able to display 2014-Q4 data by using the expression "Sum(Quantity)".

Now, my requirement is if I click on 2014-Q4, I want to display both 2014-Q4 and 2014-Q3 data on bar chart.Or if i click on 2014-Q3 i want to display 2014-Q3 and 2014-Q2.

Thanks in advance,

Bharath

6 Replies
tresesco
MVP
MVP

It depends on your quartername data format. Try to share your sample app, you would get answer faster. See:

Preparing examples for Upload - Reduction and D... | Qlik Community

Not applicable
Author

Thanks Tresco

here is the attached sample app.

Not applicable
Author

Hi Bharatt

you can make itby set analysis.

To make it simple it is better to store a specific field which links with quarter. Let's say something like

Quarter 2014-Q4

QuarterDate 01/12/2014  as format date

Then when you clikc in your list box to 2014-Q4  you will set 2 expressions

expr 1  sum(Quantity)

expr 2 sum({<QuarterDate={max(addmonths(QuarterDate,-3))}>} Quantity)  will give the result stored under 01/09/2014 means Q3-2014

best regards

Chris

tresesco
MVP
MVP

May be like attached sample.

Usually, it is better to create such fields(like Quarter Name) using  proper date function in the script or using Dual(). That helps simplify front end calculations.

Not applicable
Author

Hi tresesco,

i just realized, i cant open the file as I am using the Personal edition.

Could you please provide step by step..I am so sorry for the trouble..

Not applicable
Author

Hi,

not sure how to do it..

I tried this one..but not working..

sum({<[Start date]={max(addmonths([Start date],-3))}>} Quantity).

not sure wats the issue..

If you dont mind can you give me step by step details.Sorry for the trouble.

thanks in advance.