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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
bohravanraj
Partner - Creator II
Partner - Creator II

Cyclic in Bar Graph

Dear Folk,

I am Facing a issue in creating a Bar Chart with Cyclic Expression, where there is no problem with showing month wise data, but when user want to see Quarter wise data in Bar graph then graph should show the data of Maximum of month(for example for Q1 it should show March Data,for Q2 it should Show Jun Data, And so on) similaly for Year wise it should show Dec Data in Cyclic Dimension.

Pleas see The following Excel for more Under Standing.

YearQuarterMonthValue
2014Q1jan100
feb124
mar148
Q2apr172
may196
jun220
Q3july244
aug268
sep292
Q4oct316
nov340
dec364

  Please See anybody can Help.

Thanx

1 Solution

Accepted Solutions
sunny_talwar

Fiscal Year is easy. Currently I am dividing by 3 because I am assuming the year end to be Dec.

Join (Temp)

LOAD *,

  1 as Flag

Resident Temp

Where Mod(Month(Date), 3) = 0;

DROP Table Temp;


If your years end is Jan (for example)


Join (Temp)

LOAD *,

  1 as Flag

Resident Temp

Where Mod(Month(AddMonths(Date, -1)), 3) = 0;

DROP Table Temp;

This will now flag the 1st Month,  4th Month, 7th Month and 10th Month for quarters.

Still need to work on your 1st question

Best,

S

View solution in original post

20 Replies
sunny_talwar

You can use a if statement for expressions. Something like this:

If(GetCurrentField(Cycle_Group) = 'Month', expression1, If(GetCurrentField(Cycle_Group) = 'Quarter', expression2...and so on

HTH

Best,

S

bohravanraj
Partner - Creator II
Partner - Creator II
Author

Dear Sunindia,

Thanks for immediate reply, Can you please send a small application of it, it would really be very helpfull

Thanks

sunny_talwar

PFA the sample application.

Best,

S

bohravanraj
Partner - Creator II
Partner - Creator II
Author

But here how it is possible to find the value for Maximum of month

sunny_talwar

Oh you want to get the max value of the month. Let me fix my expression and get back to you.

Best,

S

Anonymous
Not applicable

Hi find attached app .

if(GetCurrentField(Group)='Year',sum({<Month={'dec'}>}Value),if(GetCurrentField(Group)='Quarter',sum({<Month={'mar','jun','sep','dec'}>}Value),Value))

bohravanraj
Partner - Creator II
Partner - Creator II
Author

Here User want the value of Last Month

sunny_talwar

Here you go. See if this is what you want.

Best,

S

nikhilgarg
Specialist II
Specialist II

Hey,

tried small example with year hardcoded 2014. In DImension i put Quarter , Month and in expression as:

Sum({<Year = {'2014'} , Month = {"=aggr(Max(Month), Quarter)"}>}Value)


It is giving em values for 1st month of Q1 and 1st month of Q2.


cAn anybody tell me why is it so when i have used Max(Month) ??


Thanks