Qlik Community

Ask a Question

Qlik NPrinting Discussions

Discussion Board for collaboration on Qlik NPrinting.

Announcements
Join us at the Cloud Data and Analytics Tour! REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
shaileshs
Contributor
Contributor

Complex expression (Sum if) works in qliksense table but is not displayed in nprinting report

Hi All,

I am fairly new to nprinting (but not to qliksense) , i have an app that contains a table with a measure which is basically total of 3 Sum values. each of the Sum expression contains if e.g.

Sum(if val1 = 1, col1) +

Sum if(Val2 > 1, col2 ) +

Sum if(Val3 < 3, col3 )

This produces correct value in qliksense table in qliksense app, however when i add this column to my nprinting report then this expression is not evaluated and i get all 0 ... 

Do you know why ? basically question is around if expression works in qliksense and nprinting is supposed to copy values from objects(without evaluating) then why does this not work? do I need to change something on nprinting report to inform nprinting not to evaluate etc?

 

Thanks,

S

 

 

Labels (2)
5 Replies
Ruggero_Piccoli
Employee
Employee

Hi,

I'm not able to reproduce. In my installation I create a Qlik Sense table with a measure column with a formula like if([Fiscal Year]=2011,sum([Sales Amount]),0) + if([Fiscal Year]=2012,sum([Sales Amount]),0). I regenerated the cache and the object is exported correctly.

Be sure that you formulas are correct. 

 

Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.
Lech_Miszkiewicz

Hi,

Ruggero did one smalle trick, he puts "0" as else from his IF statement so if it is false it ca n still evaluate addition. I am not 100% sure, but i do remembewr issue where you would try to evaluate Null() + value, that used to return null(). Coaleace'ing it to 0 worked for me.

This might not  be a direct answer, but definitely  you should consider it. If i were you i would make sure that my expressions are written like that in Qlik Sense.

 

cheers

Lech

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
Ruggero_Piccoli
Employee
Employee

Thanks Lech! I agree with you. It is better to add the 0 in the else part of the if and keep everything under control.



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.
shaileshs
Contributor
Contributor
Author

Thank you both, here is snapshot of my expression:

sum(if( %Var1 > 1 and %Var2 <> 1 and %Var3 > %Var4,
(%Var5 * %Var6),0))
+
sum(if(%Var1 = 1 and %Var8 > 1 and %Var2 <> 1 and %Var3 > %Var4,
(%Var5 * %Var2 * %Var7),0))
+
sum(if( %Var2 = 1 and %Var8 > 1 and %Var3 > %Var4,
%Var5,0))

 

% is hideprefix.

Even though i am using hidden variables as well as IF statements (along with else 0) this is evaluating in straight table in qliksense.

All i am doing is generating metadata for my connection in use and add this column to nprinting report which is mirror image of table in qliksense app. All other columns have valid, correct values apart from this !

Note i did add else part which was missing (thanks for that i think its useful and makes if statement clean).

Any other suggestions you can provide will be helpful as i have spent lot of time investigating this without much luck. Nprinting report is a word report with table in it.

 

Thanks,

S

 

 

 

 

Ruggero_Piccoli
Employee
Employee

Hi,

Please open a support ticket. We need to check your Qlik Sense app so include it with the Qlik NPrinting template and specify the version of the softwares you are using. 

We need to see the details to understand what is the problem. For example how the variables are defined, how appears the generated report, etc.

Best Regards,

Ruggero

 



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.