Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 jduluc12
		
			jduluc12
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
My data set looks like this
| Cust | Addr | Amount | 
|---|---|---|
| Cust1 | addr1 | 100 | 
| Cust1 | 200 | |
| Cust2 | addr2 | 300 | 
| Cust2 | 400 | 
My pivot table should like this
| Cust | Addr | Amt with addr | Amt without addr | 
|---|---|---|---|
| Cust1 | addr1 | 100 | 200 | 
| Cust2 | addr2 | 300 | 400 | 
Is it possible without changing the data set?
I tried using TOTAL to ignore Addr
like
sum(Total<Addr>Amount) for 3rd column but it brings 0 value.
Jean
 shiveshsingh
		
			shiveshsingh
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		You can try 2 expressions for output
if(len(Addr)=0,sum(Amount))
if(len(Addr)<>0,sum(Amount))
 isingh30
		
			isingh30
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Shivesh...we have to add zero in the data set first? As of now, it's blank.
Thanks.
 isingh30
		
			isingh30
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		sum({<Addr = {'addr1','addr2'}>}Amount)
sum({<Amount = {200,400}>}Amount)
I got this.
Thanks
 
					
				
		
 passionate
		
			passionate
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		PFA, Solution
 isingh30
		
			isingh30
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Can you share your code & output?
Thanks.
 shiveshsingh
		
			shiveshsingh
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Add zero for Addr? you mean this or something else?
 
					
				
		
 passionate
		
			passionate
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		LOAD Cust,
Addr,
len(Addr) as length,
Amount
FROM
[https://community.qlik.com/thread/302015]
(html, codepage is 1252, embedded labels, table is @1);
 isingh30
		
			isingh30
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Please check the question again. Your answer is not complete.
Thanks.
