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: 
Not applicable

Calculated Dimensions with Set Analysis

I'm trying to categorize some clients into either

  • Existing - have made a purchase
  • Interested - have not made a purchase but have had an appointment in the last 6 months
  • New - have not made a purchase before and have not had an appointment in the last 6 months

The complicating factor is that I am only interested in clients that have had a particular type of appointment.

When I place this expressioin into a chart it gives me the correct results,

When I try and put it into a calculated dimension it fails, I can't figure out why, any ideas?

if(

//Re Aiding

MaxString(

  {<

  [Client Code] = P({<[Reason Group] = {$(ApptType)},Invoice = {'Sale'}>})

  >}

  [Client Code]) >0,'Existing',

if(

//Second Look

MaxString(

  {<

  [Client Code] = P({<[Reason Group] = {$(ApptType)},CalendarDate = {'<=$(NewClientDate)'}>})

  >}

  [Client Code]),'Interested',

if(

//New Client

MaxString(

  {<

  [Client Code] = P({<[Reason Group] = {$(had ApptType)},CalendarDate = {'>=$(NewClientDate)'}>})

  >}

  [Client Code]),'New',

'Unclasified')))

1 Reply
marcus_sommer

For calculated dimensions you need (often) to wrap your calculation in a aggr() function - have a look here: http://community.qlik.com/blogs/qlikviewdesignblog/2014/04/08/calculated-dimensions

- Marcus