Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Marcushenriquesk

Pie chart with intervals as the slices

So, I have a pie chart that will present a count in regards to the difference of two date fields and whether the interval falls between a range of times for each slice. The counted field will be 'ACC_ID' the dimension will contain 7 hard coded slices. each slice will have a subtraction between two date fields 'Run_Date - Received_date' and the slices will have the output of that subtraction fall into the ranges: <8 hours, 8-12 hours, 12-18 hours, 18-24 hours, 24-48 hours, 48-72 hours, >72 hours. for example 3 ACC_IDS with a difference between run_date and received_date being 7 , 12, 15 respectively. the pie chart will have 33.33% of the <8 hours slice filled and 66.66% of the 12-18 hour slice filled. 

8 Replies
Marcushenriquesk
Author

any one have any ideas?

MarcoWedel

When you say "I have a pie chart ...", then what exactly is missing, i.e. what is your question?

Marcushenriquesk
Author

it means that is the analytical tool I'm using... I figured that mentioning the visual object I'm trying to get this function to work on would help with finding a solution with the community. in regards to the rest of the post do you have any idea how to do this? I'm still kind of new to Qlik sense.

Marcushenriquesk
Author

please let me know if you have any input.

Patricia_Silva
Specialist II
Specialist II

Hello @Marcushenriquesk, would you have a data set plus a screenshot so I can better understand what you need to achieve? Thank you!

Help users find answers! Don't forget to mark a correct resolution 🙂
Marcushenriquesk
Author

Yes let me provide you with two attachments. One being the data where you see 4 fields. the first being the 'ACC_ID' the next two being the run date and received date and the 4th being the difference in time (run_date - received_date) of the two date fields per acc_id in hours . the second attachment is the dumy pie chart. I made it in ms paint so excuse if it looks bad but i think it represents what im trying to ask for. you can see that there at 7 hard coded slices. The measure of each slice is the count of acc_ids who's  difference in time (or tat labeled in the excel file) falls into the ranges of each slice

Patricia_Silva
Specialist II
Specialist II

Hello @Marcushenriquesk, ah yes, I got it now, thanks a lot for attaching it! I think it could be useful to use Set Analysis on your example. I am attaching a link that provides a lot of information on how to achieve so: https://help.qlik.com/en-US/sense/February2022/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/SetAn... Please let me know if it could help you 🙂 Thank you!

Help users find answers! Don't forget to mark a correct resolution 🙂
MarcoWedel

maybe one solution could be:

 

MarcoWedel_0-1645392461312.png

using a script like

 

LOAD Distinct
     Accession						as ACC_ID, 
     Timestamp([Run Date])			as [Run Date], 
     Timestamp(RECEIVED_DATE_TIME)	as RECEIVED_DATE_TIME, 
     [TAT (Hours)],
     If([TAT (Hours)]< 8, Dual('<8 hours',0),
     If([TAT (Hours)]<12, Dual('8-12 hours',8),
     If([TAT (Hours)]<18, Dual('12-18 hours',12),
     If([TAT (Hours)]<24, Dual('18-24 hours',18),
     If([TAT (Hours)]<48, Dual('24-48 hours',24),
     If([TAT (Hours)]<72, Dual('48-72 hours',48),
     If([TAT (Hours)]>=72,Dual('>72 hours',72),
     )))))))						as Range
FROM [https://community.qlik.com/cyjdu72974/attachments/cyjdu72974/qlikview-app-development/1217481/1/test%20data.xlsx] (ooxml, embedded labels, table is Sheet1);

 

 

dimension "Range" and expression 

 

Num(Count(ACC_ID)/Count(TOTAL ACC_ID),'0%')

 

 

hope this helps

Marco