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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
upaliwije
Creator II
Creator II

Period Grouping

Hi

I have developed a QV document where I have date for 4 year stating from 2012 and monthly data as well. For me to created charts I want group months (create period dimension) in the following may

1  for 12 Months

2  for the months of May June And July

3  for Balance 9 months

Pls tell what the easiest way to do this

Thanks

1 Solution

Accepted Solutions
HirisH_V7
Master
Master

Hi,

use this both,

If(Match(Month(ShipDate),'May','Jun','Jul'),Month(ShipDate),Null()) as ThreeMonth,

If(Not Match(Month(ShipDate),'May','Jun','Jul'),Month(ShipDate),Null()) as NotThreeMonth,

HirisH

View solution in original post

3 Replies
HirisH_V7
Master
Master

Hi,

May be like this,

Extract Months and MonthNum from your date fields like this,

Data:

LOAD Customer,

    [Sales Order ID],

    ShipDate as Date,

    Month(ShipDate) as Month,

    NUm( Month(ShipDate)) as MonthNum,

    Product,

    Sales,

    Quantity

FROM

[Sales Orders.xls]

(biff, embedded labels, table is [Sales Orders$]);

Then at front end,

For 12 Months In Your Expression,

Sum({<Date={">=$(=MonthStart(Max(Date), -11))<=$(=Date(Max(Date)))"}>} Sales )

For Your Required Three Months as Dimension,

=If(Match(Month,'May','Jun','Jul'),Month,Null())

For Excluding 3 Months,

=If(Not Match(Month,'May','Jun','Jul'),Month,Null())

Periods Date -204513.PNG

Hope this helps,

PFA,

Hirish

HirisH
upaliwije
Creator II
Creator II
Author

Thanks

C I do it in load script please ?

HirisH_V7
Master
Master

Hi,

use this both,

If(Match(Month(ShipDate),'May','Jun','Jul'),Month(ShipDate),Null()) as ThreeMonth,

If(Not Match(Month(ShipDate),'May','Jun','Jul'),Month(ShipDate),Null()) as NotThreeMonth,

HirisH