Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
helen_pip
Creator III
Creator III

Help with writing script based on Inline view

Hello

I have a table which I originally built upon an inline view and wrote the expression in the pivot table to show the data. Example is below

(This is an example of what is a much larger inline table in reality)

Old Version

InLine View

Inline_MAINED:

LOAD * INLINE [

'Level Order', Level1, Level2, Level3, Level4, Level5

'3', 'TOTAL TIME SPENT IN DEPT',' NON ADMITTED', '95TH CENTILE', '<=04:00', 'CURRENT MONTH'

]; 

I then built a pivot table and wrote the following in the expression, but before long it became too large to work efficiently

Expression in pivot table

//NON ADMITTED: CURRENT MONTH

if(Level2='NON ADMITTED' AND Level5 = 'CURRENT MONTH',

Time(Fractile({<RunMonth = {$(=Max(RunMonth))}, [Patient Admitted?]={"0"} >}[Total Wait],0.95)/1440, 'hh:mm')

New Version

I then went back to my script and tried rewriting the necessary information in the script I.e.

Inline View

LOAD *, autonumber(Level1&'#'& Level2&'#'& Level3&'#'& Level4&'#'& Level5,'Inline_Monthly_Key_Overview') as Inline_Monthly_Key_Overview INLINE [
'Level Order', Level1, Level2, Level3, Level4, Level5,

'3', 'TOTAL TIME SPENT IN DEPT',' NON ADMITTED', '95TH CENTILE', '<=04:00', 'CURRENT MONTH'

];

Script

Inline_MAINED:

load

autonumber('TOTAL TIME SPENT IN DEPT'  &'#'&'NON ADMITTED' & '#' &'95TH CENTILE' &'#' & '<=04:00' &'#' & 'CURRENT MONTH','Inline_Monthly_Key_Overview') as Inline_Monthly_Key_Overview,

RunMonth = Max(RunMonth) as Inline_Monthly_Overview_MonthYear,

[Total Wait] as Inline_Monthly_Data_C,

'EDE' as Inline_Monthly_DataSource

Resident main_data

where 'MAIN_EDE_PostQVD' = data_source

and [Patient Admitted?]=0

Expression in pivot table

 

=if (Level3='95TH CENTILE',time(Fractile(Inline_Monthly_Data_C,0.95)/1440,'hh:mm'))

However I cannot get it working....Could someone kindly cast an eye over the scripting to see what amendments I need to get working, especially around the set analysis for current month

Any ideas?

Kind Regards

Helen

0 Replies