Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 deep2021
		
			deep2021
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
I have a Timespan column having values 3M, 12M, MTD.
In qlikview the if condition is working fine.
But the same if condition is not working in qliksense.
The if condition is as per the below,
=f(Timespan='MTD', sum(TOTAL{$<Timespan=,[Report Level]={'1'},Month={"$(v_MonthNoLM)"}>}HC_RSK_TE_MTD),0)
Could you please suggest on this.
Thanks
 Chanty4u
		
			Chanty4u
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		first test the expression values is showing proper or not?
=if(Timespan='MTD', 1,0) returns 1 or not check this first
then try below
test this in kpi object is it showing correct or not
sum(TOTAL{$<Timespan=,[Report Level]={'1'},Month={"$(v_MonthNoLM)"}>}HC_RSK_TE_MTD)
if yes put it in Variable
vMTD=sum(TOTAL{$<Timespan=,[Report Level]={'1'},Month={"$(v_MonthNoLM)"}>}HC_RSK_TE_MTD)
use below
=if(Timespan='MTD',$(vMTD) ,0)
 deep2021
		
			deep2021
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
I tried but no luck. Same issues. I suspect there are some issues with Timespan. Whenever I am trying to conert the column into numbers it is showing nulls.
The output of num(Timespan) is null. Same for Text(Timespan).
Thanks
 Chanty4u
		
			Chanty4u
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		how timespan is derived ?
 deep2021
		
			deep2021
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		The timespan is just the column, and it is not derived in the QS data model.
Whenever I am exporting the column in the excel, it is showing the data type as General.
Do I have to do anything is these aspect?
Also the if condition is like below,
if(Timespan='MTD',
if([Factor Type]='Total',sum(TOTAL{$<Timespan=,[Report Level]={'1'},Month={"$(v_MonthNoLM)"}>}HC_RSK_TE_MTD),
if([Factor Type]='Style',sum( TOTAL{$<Timespan=,[Report Level]={'1'},Month={"$(v_MonthNoLM)"}>}HC_RSK_TE_RESIDUAL_STY_MTD),
if([Factor Type]='Industry',sum( TOTAL{$<Timespan=,[Report Level]={'1'},Month={"$(v_MonthNoLM)"}>}HC_RSK_TE_RESIDUAL_IND_MTD),
if([Factor Type]='Currency',sum( TOTAL{$<Timespan=,[Report Level]={'4'},FT={'FX'},Month={"$(v_MonthNoLM)"}>}HC_RSK_TE_RESIDUAL_MTD),
if([Factor Type]='Mkt Timing',sum( TOTAL{$<Timespan=,[Report Level]={'1'},Month={"$(v_MonthNoLM)"}>}HC_RSK_TE_MKT_TIMING_MTD),
if([Factor Type]='Specific',sum( TOTAL{$<Timespan=,[Report Level]={'1'},Month={"$(v_MonthNoLM)"}>}HC_RSK_TE_SPECIFIC_RESIDUAL_MTD),
if([Factor Type]='Spreads',sum( TOTAL{$<Timespan=,[Report Level]={'1'},Month={"$(v_MonthNoLM)"}>}TE_RESIDUAL_SPREADS)/(100*sqrt(12)),
if([Factor Type]='Term Structure',sum( TOTAL{$<Timespan=,[Report Level]={'1'},Month={"$(v_MonthNoLM)"}>}TE_RESIDUAL_RATES)/(100*sqrt(12)),
if([Factor Type]='Country',sum( TOTAL{$<Timespan=,[Report Level]={'1'},Month={"$(v_MonthNoLM)"}>}HC_RSK_TE_RESIDUAL_CTY_MTD))))))))))
,0)
Is there any issues because of the nested if statements?
When i checked separately, the inner if conditions are working fine, and there is issue related to the outer one.
It's not working means, What is the error?
