Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Min date by dimension

Hi, I would like to get an expression built where I am able to see a minimum service date by a specific dimension (in this case a patient record number). I'm sure this is simple, but haven't found an example in the discussion forums.

1 Solution

Accepted Solutions
sunny_talwar

Try this

Min({<Year>} TOTAL <[Patient Record Number]> Date) * Avg(1)

View solution in original post

13 Replies
sunny_talwar

Where are you looking to show this? In a chart? Then add the patient record number as dimension and Min(Date) as expression

Not applicable
Author

Hi Sunny,

I'm trying to add this in an expression. I have the patient record number as a dimension but also have other dimensions added as well. I want my expression to ignore all the other dimensions and only give me the minimum date for the patient record number.

sunny_talwar

Try this

Min(TOTAL <[Patient Record Number]> Date)

Not applicable
Author

Thanks Sunny; this worked for me. However, if I want the expression to ignore my selection for year, where would I need to include the $ sign?

sunny_talwar

This

Min({<Year>} TOTAL <[Patient Record Number]> Date)

Not applicable
Author

Thank you!!!

sunny_talwar

Why 'Assumed Answer'? The expression I provided did not work for you? Please mark the appropriate response as correct and helpful

Qlik Community Tip: Marking Replies as Correct or Helpful

Best,

Sunny

Not applicable
Author

Sorry, I take that back. It actually didn't work as intended. After adding the {<Year>} logic, I am getting results in prior years. Here's my objective:

1) I need to find the first service date for a patient (using minimum expression) irregardless of the years I have selected.

If I add the logic you sent me, the years that I did not select have populated in my dataset in order for the minimum expression to work. That's not how I want my data presented.

Instead, I would like only the years I've selected to populate with patient data, however the single column which is driven by my expression should tell me the first service date for a particular patient. Make sense?

sunny_talwar

Try this

Min({<Year>} TOTAL <[Patient Record Number]> Date) * Avg(1)