Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
sahajaqlik
Contributor

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
Valued Contributor

Re: changing column into row

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
;
sahajaqlik
Contributor

Re: changing column into row

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    

 

 

 

 

sahajaqlik
Contributor

Re: changing column into row

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

sahajaqlik
Contributor

Re: changing column into row

Anyone  please  check

sahajaqlik
Contributor

Re: changing column into row

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