Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
chinnu123
Creator
Creator

Year and quarter data representation in a bar chart

Hi Community,


I need to represent a last 12 months data and last 3 months data in a same bar chart.


can any one help to solve the issue please

Thanks in advance,

Regards,

Chinnu.

1 Solution

Accepted Solutions
sunny_talwar

This?

Capture.PNG

Script:

Table:

LOAD Group,

    Incident,

    Date as TimeStamp,

    Date(Floor(Date)) as Date,

    Time(Frac(Date)) as Time

FROM

[Sample year and quarter.xlsx]

(ooxml, embedded labels, table is Sheet1);

Bar Chart:

Dimension: Group

Expressions:

1) =Count({<Date = {"$(='>=' & Date(AddMonths(Max(Date), -11)) & '<=' &  Date(Max(Date)))"}>} Incident)

2) =Count({<Date = {"$(='>=' & Date(AddMonths(Max(Date), -2)) & '<=' &  Date(Max(Date)))"}>} Incident)

View solution in original post

20 Replies
pamaxeed
Partner - Creator III
Partner - Creator III

Hi,

you can do something like that:

1) Create a Master Calendar with Year, Quarter, Month

2) In your bar Chart use a Drill Down Group with Year and Quarter

In this case it is possible to show Year And Quarter in one bar chart.

Is that what you are looking for?

Cheers,

Patric

chinnu123
Creator
Creator
Author

Hi Pattric,

Thanks for your quick response .Actually in my bar chart last 12 months and last 3 months must be represented side by side .

I am attaching sample screenshot  so that you will be have a better view.

In my attached image orange represents Year and blue represents Quarter..

image5.JPG

Thanks in advance

Regards,

Chinnu.

pamaxeed
Partner - Creator III
Partner - Creator III

Hi again,

is the orange year or month?

What is the dimension in that bar chart?

Patric

sunny_talwar

May be use this in your expression:

For last 12 months: {<DateField = {"$(='>=' & Date(AddMonths(Max(DateField), -12), 'YourDateFieldFormat') & '<=' &  Date(Max(DateField), 'YourDateFieldFormat'))"}>}

For last 3 months: {<DateField = {"$(='>=' & Date(AddMonths(Max(DateField), -3), 'YourDateFieldFormat') & '<=' &  Date(Max(DateField), 'YourDateFieldFormat'))"}>}

chinnu123
Creator
Creator
Author

Hi Patric,

We are representing data for 11 groups for each group we are representing  year and quarter data.

Hope you understand!

pamaxeed
Partner - Creator III
Partner - Creator III

Try to follow the instructions of Sunny

chinnu123
Creator
Creator
Author

Hi Sunny,

Its not working in my scenario.

sunny_talwar

What is your scenario?

chinnu123
Creator
Creator
Author

Ok let me explain..

I have group names called Admin and incident id's and in the admin group there are no of issue names but i need to take top 10 issues in that group based on the count of incidents id's and  I need to show the bar graph for last 12 months and last 3 months  side by side for the top 10  issues in admin group.

Here I am taking issue names as dimension and count(Incident id's) as expression.

            Hope you will understand

Thanks in advance..