Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Read about the latest Qlik Community enhancements on the Community News blog!
cancel
Showing results for 
Search instead for 
Did you mean: 
martynlloyd
Partner
Partner

Use of Min in calculated dimension

Can anyone tell me why I can't use Min(adate) in a calculated dimension?

='Contract End from ' &  ' ; Contract Types ' & GetFieldSelections([Contract Type])

works fine,

but

='Contract End from ' & min([Contract End]) &  ' ; Contract Types ' & GetFieldSelections([Contract Type])

Does not.

Regards,

M

1 Solution

Accepted Solutions
JonnyPoole
Employee
Employee

I didn't hear it but i think you are going for a min date across all records in the current selections, not a dimensional mininmum. if that is the case this works in your sample as well:

=date(Min( total EndDate)) 

View solution in original post

12 Replies
marcarreras
Specialist
Specialist

Does it give you an error or the result is not the expected?

Try replacing min([Contract End])   by:

min(Aggr([Contract End], [Contract End]))

Marc.

JonnyPoole
Employee
Employee

Do you want it to be the min out of every date in the chart ,  in the current selection, in the date model ? 

See below for min date in a year and min date in whole chart .  expressions are in the column header:

Capture.PNG.png

martynlloyd
Partner
Partner
Author

Hi, the main problem is that I get the error

// Error in calculated dimension

Thanks,

M.

JonnyPoole
Employee
Employee

Can you share a sample (qvw)  ? 

martynlloyd
Partner
Partner
Author

Example attached

JonnyPoole
Employee
Employee

Is this what you need ?

Calculated dimension formula:    =date(aggr(Min(EndDate),Customer))

Capture.PNG.png

abeyphilip
Creator II
Creator II

Hi,

Can you try it using a variable?

Please check attached qvw.

Regards,

Abey

martynlloyd
Partner
Partner
Author

Interesting idea, it certainly solves the syntax error, but no use because the dim has to be dynamic - based on the selection.

Regards,

M.

abeyphilip
Creator II
Creator II

But where have you set the variable. I hope not in the load script.

Because if it is from the - "Settings -> Variables Overview", those variables are dynamic and it will change as per your selection of the field used in variable definition.

Regards,

Abey