Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

Reduce calculated dimension

Hi All

How to reduce calculated dimension, i want to put in variable, my calculated dimension is =If(Time((PlanMonth))>=today() AND (PlanMonth)<=(today()+ 30), Date(Floor(PlanMonth)))

Thanks in advance

9 Replies
MVP
MVP

Re: Reduce calculated dimension

Your requirement is not clear. How do you want to "reduce" the dimension, and what exactly do you want to "put in variable"?

ramoncova06
Valued Contributor III

Re: Reduce calculated dimension

what do you mean by reducing ?

are you trying to simplify it ?

Not applicable

Re: Reduce calculated dimension

hi jonathan and ramon, i want to put that into variable form. user asking to remove calculated dimension as much as possible.

Employee
Employee

Re: Reduce calculated dimension

Then you should define it in the script and store the result in a field.

   If(PlanMonth >= today() AND PlanMonth<=today() + 30, Date(Floor(PlanMonth))) as PlanMonth2,

HIC

johanlindell
Contributor II

Re: Reduce calculated dimension

Put the formula into you load script. In the script loading the PlanMonth column add a new calculated field

Table:

LOAD *,

     If(Time((PlanMonth))>=today() AND (PlanMonth)<=(today()+ 30), Date(Floor(PlanMonth))) as [New field]

FROM MyFile.qvd (qvd);

richard
Contributor

Re: Reduce calculated dimension

Hi Rohithhrs,

You should create a measure to use only the measure name in whatever object you like. Here is how to do it:

Create ( and use ) a variable in Qlik Sense. | Qlik Sense Tales

ramoncova06
Valued Contributor III

Re: Reduce calculated dimension

I believe HIC already gave you the answer, since your requirement is to remove calculated dimensions (which I assume is due to performance issues) it would be better to create a new field for it, instead of creating a variable which will still be calculated at the presentation layer

Not applicable

Re: Reduce calculated dimension

Thanks to all, hi have put like this

Step 1- adding this to the variable list

vplanmonth-  If(Time((PlanMonth))>=today() AND (PlanMonth)<=(today()+ 30), Date(Floor(PlanMonth)))


step 2- i replaced in calculated dimension  as   =$(vplanmonth)

but its not showing exact values.

MVP
MVP

Re: Reduce calculated dimension

Several people have already told you to take the expression to your load script to create a calculated field.

Replacing the calculated dimension with a variable will perform exactly the same way as the calculated dimension, except that its harder to maintain (and debug, as you have seen).

Community Browser