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

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
cicciput
Contributor III
Contributor III

Indirect Set Analysis on Rolling Period

I cannot understand what's happening here, I wonder if some expert can shine a light on this thing.

I want to compare buyers of a quarter VS the previous one.

To get there I'm using Indirect Set Analysis with 2 AsOfMonth.Type: RQ (Rolling Quarter) and PRQ (Previuos Rolling Quarter)

tables.png

With no selections this expression returns no results or always 0:

Sum({$< Account.ID =

  p({$< AsOfMonth.Type = {'PRQ'} >} Account.ID) -

  p({$< AsOfMonth.Type = {'RQ'} >} Account.ID) >}

Account.DCF)

no_selection.png

while it works if I select a single month:

with_selection.png

Here are the LOAD statements for who's willing to help me understand, thanks in advance for your support.

Account:

LOAD * INLINE [

    Account.ID, Account.Name, Account.DCF

    1, Company A, 1

    2, Company B, 1

    3, Company C, 1

];

Purchase:

LOAD * INLINE [

    Account.ID, Date

    1, 27/02/2015

    2, 20/02/2015

    2, 20/11/2014

    3, 10/10/2014

];

Cal:

LOAD

  TempDate AS Date,

  MonthName(TempDate) AS Cal.MonthName;

LOAD

  Date(mindate + IterNo()) AS TempDate

WHILE mindate + IterNo() <= maxdate;

LOAD

  Min(Date) -1 AS mindate,

  Max(Date) AS maxdate

RESIDENT Purchase;

AsOfMonth:

LOAD Cal.MonthName AS AsOfMonth.MonthName,

    MonthName(AddMonths(Cal.MonthName, 1 - IterNo())) AS Cal.MonthName,

    IF(IterNo() < 4, 'RQ', 'PRQ') AS AsOfMonth.Type

RESIDENT Cal

WHILE IterNo() <= 6;

Labels (1)
12 Replies
sunny_talwar

So its working now? I was working on it right now and was not sure how I would do it. I am glad that you have figured it out.

cicciput
Contributor III
Contributor III
Author

Yes, I'm asked to work on a monthly basis so on the real app I'll need to round it up but the concept is working.

Thanks for helping me to understand Set Analysis could not work in this situation.

sunny_talwar

Not a problem my friend. I am glad I was able to guide you in the right direction.