Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
aishan07
Contributor II
Contributor II

Weekly sum and Distinct count by weeks inside bins

Hi, I have a dataset and I have mimicked 2 weeks data below: 

DateTotal HoursName

05-07-2020

1.8A
05-07-20201.2A
05-07-20202.2B
06-07-20203.6B
06-07-20201A
07-07-20202B
08-07-20203A
09-07-2020

4

A
10-07-20201B
11-07-20201B
12-07-20201B
13-07-20201C
14-07-20201C
15-07-20201D
16-07-20201F
17-07-20201G
18-07-20201D

 

The final result that we need is to have bins, in below format:

BinsTotal Hours(Weekly Basis)Distinct Count(Weekly Basis)
0-275
2-800
Above 8192

 

It should follow this logic in the background:

WEEK1 9.2 A

WEEK1 9.8 B

WEEK2  1 B

WEEK2  2 C

WEEK2  2 D

WEEK2  1 F

WEEK2  1 G

That is, it should sum [Total hours] by weeks using a distinct count of [Name] Column.

Please help.

Labels (4)
1 Solution

Accepted Solutions
albertovarela
Partner - Specialist
Partner - Specialist

Take a look at the attached qvf.  I aggregated the data in the script and assign the bins using intervalmatch

 

map location.jpg

 

 

View solution in original post

1 Reply
albertovarela
Partner - Specialist
Partner - Specialist

Take a look at the attached qvf.  I aggregated the data in the script and assign the bins using intervalmatch

 

map location.jpg