Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

How-to applymap() a calculated expression to a desc. field

Hi folks,

Referring to the title above, would anyone know how I can go about doing this?

The situation that I am facing is as such, 1 dim --> UserID, has a time-stamp associated with it (whenever the user uses the service, a time-stamp is generated). I am calculating an expression based on the MAX(DATE) - MIN(DATE) to find out the range of days he/she has been actively using the service. Once that expression has been computed, am going to compute another expression -- having an if(MAX(DATE) - MIN(DATE) <= 90, '1-3 Months', ...) naming it [ActiveMths_GROUP].

Now that is done, I would like to GROUP the number of users based on the previously calculated expression --> [ActiveMths_GROUP]I have been trying a few methods, even using applymap() in an expression, but have failed terribly.

Please help!. Thanks in advance. Much appreciated.

Best Regards,

R

1 Solution

Accepted Solutions
preminqlik
Valued Contributor II

Re: How-to applymap() a calculated expression to a desc. field

hi once try this

Use the following in calculated dimension

if(aggr(max(Date)-min(Date),USERID)<=90,'0-90',

if(aggr(max(Date)-min(Date),USERID)>90 and aggr(max(Date)-min(Date),USERID)<=180,'90-180'))      

View solution in original post

4 Replies
preminqlik
Valued Contributor II

Re: How-to applymap() a calculated expression to a desc. field

Use [Active Months_Group] as a calculated dimension

Not applicable

Re: How-to applymap() a calculated expression to a desc. field

Hi Prem,

In the same table? I don't think that's possible.

preminqlik
Valued Contributor II

Re: How-to applymap() a calculated expression to a desc. field

hi once try this

Use the following in calculated dimension

if(aggr(max(Date)-min(Date),USERID)<=90,'0-90',

if(aggr(max(Date)-min(Date),USERID)>90 and aggr(max(Date)-min(Date),USERID)<=180,'90-180'))      

View solution in original post

Not applicable

Re: How-to applymap() a calculated expression to a desc. field

Thanks mate.