Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello, I'm having a problem with the following calculated dimension:
=if([Fiscal Year] <= max({$<
[District Name] = {'$(vMyDistrictName)'}
>}[Fiscal Year]
), [Fiscal Year]
)
I'm trying to get the maximum value for fiscal year and then only have the Axis go up to that value. Nothing is wrong with the Max() function because I have it displaying the correct year in a text box. QlikView just says that there is an error in expression and doesn't show any dimension values on the x-axis.
If you used an aggregation-function within a calculated dimension you need to wrap the expression with an aggr-function, it should more look like:
=aggr(
if([Fiscal Year] <= max({$<
[District Name] = {'$(vMyDistrictName)'}
>}[Fiscal Year]
), [Fiscal Year]
),
[Fiscal Year])
Have also a look here:Calculated Dimensions
- Marcus
Could you post your sample application?
May be this:
=If([Fiscal Year] <= Max(TOTAL {$<[District Name] = {'$(vMyDistrictName)'}>}[Fiscal Year]), [Fiscal Year])
If you used an aggregation-function within a calculated dimension you need to wrap the expression with an aggr-function, it should more look like:
=aggr(
if([Fiscal Year] <= max({$<
[District Name] = {'$(vMyDistrictName)'}
>}[Fiscal Year]
), [Fiscal Year]
),
[Fiscal Year])
Have also a look here:Calculated Dimensions
- Marcus
I think that this was correct. I ended up solving the problem I was having without using a calculated dimension so I'm not sure if this works, but from what you are saying I think it would. Thanks for all the help everyone.
Hi Marcus,
Hope you're well.
I have the same problem, I am trying to create a calculated dimension with below expression but I get the error.
I don't know how exactly I can wrap this inside aggr() function:
if(FirstSortedValue(DueIn,-%DateKey)<0
,'Overdue'
,if(FirstSortedValue(DueIn,-%DateKey)>=0
AND FirstSortedValue(DueIn,-%DateKey)<=5
AND WCategory='1'
,'Due Soon'
,if(FirstSortedValue(DueIn,-%DateKey)>=0
AND FirstSortedValue(DueIn,-%DateKey)<=14
AND WCategory='2'
,'Due Soon'
,if(FirstSortedValue(DueIn,-%DateKey)>=0
AND FirstSortedValue(DueIn,-%DateKey)<=30
AND WCategory='3'
,'Due Soon','Seen in Time'))))
The aggr comes on the outside in this way:
aggr(
if(FirstSortedValue(DueIn,-%DateKey)<0
,'Overdue'
,if(FirstSortedValue(DueIn,-%DateKey)>=0
AND FirstSortedValue(DueIn,-%DateKey)<=5
AND WCategory='1'
,'Due Soon'
,if(FirstSortedValue(DueIn,-%DateKey)>=0
AND FirstSortedValue(DueIn,-%DateKey)<=14
AND WCategory='2'
,'Due Soon'
,if(FirstSortedValue(DueIn,-%DateKey)>=0
AND FirstSortedValue(DueIn,-%DateKey)<=30
AND WCategory='3'
,'Due Soon','Seen in Time')))),
DueIn,%DateKey)
whereby I assume that DueIn and %DateKey are the needed dimensions for it.
- Marcus