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: 
qlikapple
Creator
Creator

changing column into row

 

Hi all , can anyone pleae help me, as it is very urgent

 

CRNOOUTIDONLINEDEGRADEDMINUTES        
CR25780381NY10        
 2NY20        
 3YN30        
 4YN40        
             
             
Actually the requirement is ther is one filed called Outscopewhich is either online or degraded, I have to keep the flags Y or N   
so in the backend I have creaated flags for both and cretaed 2 fileds like below       
if(MATCH(SCOPE_NAME,'DEGRADED'),'Y','N') as DEGRADESCOPE,        
if(MATCH(SCOPE_NAME,'ONLINE'),'Y','N') as ONLINESCOPE,        
             
Now my requirement is there is one field called Minutes, similarly I have to diffrenetiate the sum of the ONLine minutes   and sum of the Degraded minutes
             
             
I need to bring like this           
             
CRNOONLINEDEGRADEDONLINEMINUTESDegrade MINUTES        
CR2578038NY3070        
             
I want like above , how to do in back end, I need to get in the same row       
             
Labels (1)
5 Replies
zhadrakas
Specialist II
Specialist II

Here is a script that should fit your Needs:
Replace the first Inline Load with your current Load Statement.

TEST:
LOAD * INLINE [
CRNO, OUTID, ONLINE, DEGRADED, MINUTES
CR2578038, 1, N, Y, 10
CR2578038, 2, N, Y, 20
CR2578038, 3, Y, N, 30
CR2578038, 4, Y, N, 40
];

TEST_AGG:
Load CRNO,
sum(if(ONLINE='Y', MINUTES)) as ONLINE_MINUTES,
sum(if(DEGRADED='Y', MINUTES)) as DEGRADE_MINUTES
Resident TEST
GROUP BY CRNO
;
qlikapple
Creator
Creator
Author

I am not gettting as excepted

 

 

The below one is original ouput which i want

Change Order NumberDisruptive change (Full)Full Outage MinutesDisruptive change (Degraded)Degraded Outage minutesDisruptive Free changeIncident Number 
CR2574825Y331N22,447NIN44448108 
        
        
as I have done that but I am getting like this   
        
        
        
 
       
        
        
        
        
        
        
        
        
        
        
in the script, I have wriiten like this    

 

 

Change Order NumberDisruptive change (Full)Full Outage MinutesDisruptive change (Degraded)Degraded Outage minutesDisruptive Free changeIncident Number 
CR2574825Y331N22,447NIN44448108 
        
        
as I have done that but I am getting like this   
        
        
        
 
       
        
        
        
        
        
        
        
        
        
        
in the script, I have wriiten like this    

 

 

 

 

qlikapple
Creator
Creator
Author

HI ,

please find the attached , i am not getting the Output as expected, please find the first one which i need like this,  but i am getting like second one

can anyone please check

qlikapple
Creator
Creator
Author

Anyone  please  check

qlikapple
Creator
Creator
Author

please find the dummy data CRNO OUTSCOPE OUTAGEMINUTES IN NO 1234 ONLINE 32 11234 1234 DEGRADE 11234 2341 ONLINE 21 ABC 2341 DEGRADE 32 ABC 2341 ONLINE 43 ABC 123456 DEGRADE 21 2312 123456 DEGRADE 32 2312 123456 DEGRADE 21 2312 123456 ONLNE 21 2312 The requirement is like this , I want to show IN NO as single(unique) so that it should not repeat again , Now I want the o/p as CRNO OUTSCOPE(ONLINE Y) ONLINE MINUTES OUTSCOPE(DEGARDE Y) DEGRADE MINUTES IN NO 1234 Y 32 N 0 11234 2341 Y 21 Y 75 ABC 123456 Y 21 Y 74 2312