Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello All, I dont know why get a error when try Load this Script:
"
Budget:
LOAD DISTINCT
ApplyMap('Mapeo_Hi',AccountAct) As Account,
if (AccountAct ='Ton', sum(ValorActBN), Sum(ValorActBN)*1000 ) AS Valor,
FROM [lib://Hi\0619+\*.xlsx](ooxml, embedded labels,header is 1 lines,table is EERR_Norte)
GROUP BY ApplyMap('Mapeo_Hi',AccountAct),Mid(FileName(),FindOneOf( FileName(), '_')+1, 4) ,Capitalize(Mid(FileName(),1, FindOneOf( FileName(), '_')-1));
"
I get a "Invalid expression" whe try to Load.
I know that the problem is this line: "if (AccountAct ='Ton', sum(ValorActBN), Sum(ValorActBN)*1000 ) AS Valor, "
If I reemplace it for: " Sum(ValorActBN)*1000 AS Valor," the load is correct, but I need to *1000 all the data except the AccountAct named "Ton"
Any one can Help? Thx for advance.
I believe it should be:
Sum(ValorActBN * if(AccountAct ='Ton', 1, 1000)) AS Valor,
-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com
I believe it should be:
Sum(ValorActBN * if(AccountAct ='Ton', 1, 1000)) AS Valor,
-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com
Thanks Rob, Now the load don't show any error, but the expression is not calculated, all AccountAct are in empty in the database. Any idea?
Jorge
Not sure. Can you upload a sample?
Hi Rob, I've had a mistake in my code. You are right the solution works perfect.
Thanks very much!
Regards
Jorge