Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us at Qlik Connect 2026 in Orlando, April 13–15: Register Here!
cancel
Showing results for 
Search instead for 
Did you mean: 
SGV
Creator II
Creator II

Find out which Day (Sun, Mon, Tue) etc. has the highest value occurred (aggregated at a weekly level)

Hello,

I want to create a bar chart like below. 

SGV_0-1753378941492.png

Background Logic:

SGV_2-1753379435239.png

 

Sample data of temperatures has been attached below.  

requirement:

For each date, there is a highest and a lowest value. I want to calculate on which days the highest and lowest values occurs , aggregated at a weekly level. Please see attached 1st pic. 

This will allow me to understand, on average, on what days I need to turn on the cooling systems.

 

Labels (3)
1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

In script it can be solved like:

Daily:
LOAD
    Date("Date") as Date,
    WeekName("Date") as Week,
    WeekDay("Date") as WeekDay,
    high,
    low
FROM [lib://downloads (azuread_robwunderlich)/Qlik Sense - Untitled - Table - July 24, 2025 (1).xlsx]
(ooxml, embedded labels, table is Sheet1);
 
Left Join (Daily)
LOAD
Week,
    Max(high) as high,
    1 as IsHigh
Resident Daily
Group by Week;
 
Left Join (Daily)
LOAD
Week,
    Min(low) as low,
    1 as IsLow
Resident Daily
Group by Week;
 

View solution in original post

5 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi there,

This is a tricky problem that can be solved with the function FirstSortedValue(), in combination with the advanced aggregation function AGGR().

Allow me to invite you to my Qlik Expert Class that will take place in Vienna, Austria on March 22nd, where I will be teaching advanced development techniques. This problem is just one of many hands-on exercises in my Set Analysis and AGGR() session. 

Ask me about Qlik Sense Expert Class!
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

In script it can be solved like:

Daily:
LOAD
    Date("Date") as Date,
    WeekName("Date") as Week,
    WeekDay("Date") as WeekDay,
    high,
    low
FROM [lib://downloads (azuread_robwunderlich)/Qlik Sense - Untitled - Table - July 24, 2025 (1).xlsx]
(ooxml, embedded labels, table is Sheet1);
 
Left Join (Daily)
LOAD
Week,
    Max(high) as high,
    1 as IsHigh
Resident Daily
Group by Week;
 
Left Join (Daily)
LOAD
Week,
    Min(low) as low,
    1 as IsLow
Resident Daily
Group by Week;
 
SGV
Creator II
Creator II
Author

@rwunderlich I tried like below as I can only implement a Front End solution:

Measure (Y axis in bar chart)

SGV_0-1753384310227.png

Dimension (X-axis in bar chart) - (WeekDay = Sun, Sat etc. )

SGV_1-1753384380689.png

 

However I am not getting the correct answers

 

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

@SGV try this: 

Dimension: WeekName 

Measures:

High:

FirstSortedValue( WeekDay, 
- AGGR(max(High), WeekName, WeekDay)
)
 
Low:
FirstSortedValue( WeekDay, 
AGGR(min(Low), WeekName, WeekDay)
)
 
Cheers,
Oleg Troyansky 
Ask me about Qlik Sense Expert Class!
SGV
Creator II
Creator II
Author

I don't think this solution is working as I need to use Dayname (Sat, Sun, Tue) etc. in the X axis (as a Dimension). Rob's solution works but I can only do this in the front end