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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

HOW TO CREATE QUARTERS

I need to create A BAR CHART with 4 bars each represention Q1,Q2,Q3,Q4 respectively.

so If I select <=Mar , then I will see only 1 bar 'Q1', if I select for example May, I wanna see Bar for 'Q1' and bar for 'Q2'  and so on.

I have Year and Month dimensions.  How can I do that

15 Replies
sunny_talwar

May be we can help you better if you can attach a sample?

Not applicable
Author

Here  is sample Data

LOAD * INLINE [

    Month, Type, Amount

    Mar, Total Incurred, 28200

    Jan, Total Incurred, 19200

    Feb, Total Incurred, 5000

    Apr, Total Incurred, 18000

    May, Indemnity Incurred,12000

    Jun, Indemnity Incurred, 13000

    July , Indemnity Incurred, 9000

    ];

   

So If I Select Mar I wanna see Bar for Q1 with Jan, Feb and Mar Aggregated, and if I select Apr I wanna see Bar for 'Q1' and 2nd Bar for 'Q2'

sunny_talwar

Something like this?

Capture.PNG

I used 2 dimensions, one is calculated dimensions

='Q' & Ceil(Month/3) and Type

Expression: =Sum({<Month = {"$(='>=' & 1 & '<=' & Max(Month))"}>}Amount)

maxgro
MVP
MVP

see attachment

1.png

Not applicable
Author

Can you please attach a QVW?

sunny_talwar

Both of us did

Open this link to find the attachment: Re: HOW TO CREATE QUARTERS

Not applicable
Author

In your script

load

  *,

  'Q' & ceil((Month/3)) as Quarter;

load

  *,

  Year(Date) as Year,

  Month(Date) as Month;

load

  makedate(2015, ceil(rand()*12)) as Date,

  ceil(rand()*10) as Val

AutoGenerate 1000;

what is makedate(2015, ceil(rand()*12)) doing and I have multiple years, what is 2015 in there.

and I need the data to be cumulative, meaning,Q2, will be Q1 and Q2, and Q3 will be (Q1,Q2,Q3)

sunny_talwar

I think your sample did not include year and date, so maxgro‌ must have created some dummy data for you to show the sample. If you can share a more representative sample (which include years) and stuff we might be able to get you a more relevant solution .

Also have you looked at my solution?

Not applicable
Author

in my case the Type is a Value List dimension so in the Expression I am using If

ValeuList (..........) -'Indemnity Incurred',

your expression, it doesnt work,