Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Minimum dimension

I am having a problem finding the minimum dimension within my chart.  Week is my dimension and I am creating a trendline based on the week.  The lowest possible value for week is the week start of the current week and the max possible value for week is 78 weeks from this week.  My week dimension is always the start of the week (monday).

If the week is equal to the weekstart of today, then that is week1 and my calculation works fine.  However sometimes I only have data for week 3, 4, and 5 but not week1.  If this is the case then I need to do A for week 3 and B for the rest of the weeks.  My ultimate goal is to do A for the lowest week in my data and B for the rest.  Here are a few calculations I tried.  Any help would be much appreciated.

Works only if I have data for week 1:

if(Week = WeekStart(Today()), A, B )

Does not work, always does A and never does B.  It must always be matching the same week to itself.

if(Week = min(Week), A, B )

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Try

if(Week = min(TOTAL Week),A,B)

View solution in original post

7 Replies
Not applicable
Author

What type of data is returned for your Week field?

Not applicable
Author

The week is in date format, mm/dd/yyyy

swuehl
MVP
MVP

Try

if(Week = min(TOTAL Week),A,B)

Not applicable
Author

Try this:

if(Week=min(Total Week),A,B)

Not applicable
Author

Using min(TOTAL week) seems to give the same results as min(week).

swuehl
MVP
MVP

Chris,

min(TOTAL Week) should return the minimum Week of all Week values in your dimension (Week is still your dimension, right?

While min(Week) will return the min(Week) for all Weeks in the subset created by the dimension value grouping (if you use Week as dimension, there is only one distinct value, the current Week of that line, so min(Week) = Week for all lines).

Could you post a small sample here?

Stefan

Not applicable
Author

min(TOTAL week) ended up working, thanks guys.  My testing was showing incorrectly for a minute but I realized it was a data issue.