Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
Your requirement is not clear. How do you want to "reduce" the dimension, and what exactly do you want to "put in variable"?
what do you mean by reducing ?
are you trying to simplify it ?
hi jonathan and ramon, i want to put that into variable form. user asking to remove calculated dimension as much as possible.
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
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);
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
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
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.
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).