9 Replies Latest reply: Sep 11, 2015 3:22 AM by Jonathan Dienst

# 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)))

• ###### 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"?

• ###### Re: Reduce calculated dimension

what do you mean by reducing ?

are you trying to simplify it ?

• ###### 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.

• ###### 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

• ###### 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

• ###### Re: Reduce calculated dimension

Table:

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

FROM MyFile.qvd (qvd);

• ###### 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

• ###### 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.

• ###### 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).