Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I need help in converting the below SQL querys to qlik scripting.
[ConvAdv] = SUM(CASE WHEN [AdvanceProduct] = 123 THEN [OutstandingBalance] END)
[Overdrawn] = ABS(SUM([BookBalanceAfterInterestEOD]))
Thanks in Advance.
Hello Mahesh,
Please try with this,
Sum(If(AdvanceProduct = 123 and OutstandingBalance,OutstandingBalance)) as ConvAdv
Hello @Mukesh_s,
I believe it should be:
[ConvAdv] = SUM(IF([AdvanceProduct] = 123, [OutstandingBalance]))
Regards,
Benoit
Hello Mahesh,
Please try with this,
Sum(If(AdvanceProduct = 123 and OutstandingBalance,OutstandingBalance)) as ConvAdv
@Mukesh_s envie uma amostra de dados, para que possa compreender melhor a sua necessidade, fiz aqui uma pequena amostra, mas precisaria avaliar mehor o seu objetivo.
//[ConvAdv] = SUM(CASE WHEN [AdvanceProduct] = 123 THEN [OutstandingSaldo] END)
Fiz essa leitura :
//Se [AdvanceProduct] = 123 então Soma([OutstandingSaldo])
//[ConvAdv] = [OutstandingSaldo]
[Teste]:
Load *
Inline [
ConvAdv, AdvanceProduct, OutstandingSaldo
15, 123, 10
20, 123, 9
15, 122, 15
];
Teste1:
Load
*,
If(ConvAdv = "Nome Campo", 'OK') AS 'Status'
;
Load
AdvanceProduct,
Sum(ConvAdv) As 'ConvAdv',
If(Match("AdvanceProduct", 123), Sum("OutstandingSaldo")) As 'OutstandingSaldo' //SUM(CASE WHEN [AdvanceProduct] = 123 THEN [OutstandingSaldo] END)
resident Teste
Group By AdvanceProduct
;
exit script;
seria interessante enviar uma amostra para uma melhor compreensão. 👌🏽