Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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
MVP
MVP

Re: Min date by dimension

Try this

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

13 Replies
MVP
MVP

Re: Min date by dimension

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

Re: Min date by dimension

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.

MVP
MVP

Re: Min date by dimension

Try this

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

Not applicable

Re: Min date by dimension

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?

MVP
MVP

Re: Min date by dimension

This

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

Not applicable

Re: Min date by dimension

Thank you!!!

MVP
MVP

Re: Min date by dimension

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

Re: Min date by dimension

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?

MVP
MVP

Re: Min date by dimension

Try this

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