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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
rmooney-jvchc
Contributor II
Contributor II

Function within a Set Analysis

I'm new to using a set analysis and have watched a few videos, but am still having a problem getting this to work correctly.  I'm using QlikView 12, and I'm wanting to get a count of values from a year prior to the date.  Here is the formula I'm using:

Count({$<[Date]={"$(=addyears([Date],-1))"}>}[Date])

So I'm trying to get something that lists my Date, the Date a year ago, the count of values for the Date, and the count of values for a year ago from the Date.  Any help as to what I'm doing wrong would be greatly appreciated.

12 Replies
sunny_talwar

Would you be able to share a sample to show your issue?

rmooney-jvchc
Contributor II
Contributor II
Author

Attached is a sample of the document/data I'm working on.  It's the 4th column (2nd expression) I'm having problems with.  Looking at that sample data, here is what I'm needing the first row to look like:

Date               Date PY          Count CY          Count PY

6/6/2017          6/6/2016                    98                   103

sunny_talwar

Use The As-Of Table‌ here

Table:

LOAD Date,

    [Count CY]

FROM

Book1.xlsx

(ooxml, embedded labels, table is Sheet1);

AsOfTable:

LOAD Date as AsOfDate,

  Date,

  'CY' as Flag

Resident Table;

Concatenate (AsOfTable)

LOAD Date as AsOfDate,

  Date(AddYears(Date, -1)) as Date,

  'PY' as Flag

Resident Table;

Capture.PNG