Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Code Functionality

Hi

Can anyone explain me what is the below code doing

if(Cashflow_Amount<0,'#,##,##,##0;(#,##,##,##0)','#,##,##,##0;#,##,##,##0')

Regards,

keerthi KS

3 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

I assume that this is a fragment of an expression. It returns a format string; selecting the first at the total row if the Cashflow_Amount is negative.

However, I suspect that it does not work because the naked* field Cashflow_Amount probably cannot evaluate at a total level; so the condition will always be false, and it will always return the "else" condition.

* a field without an aggregation function like Sum(), Avg(), Min()....

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Kushal_Chawda

It's just formatting the numbers based on the Dimension.

Here, Dimensionality()=0  refers to First Dimension of the Pivot Table.

So when you do collapse all to First Dimension  and (Dimensionality()=0 and Cashflow_Amount<0) condition satisfied then format the number as  '#,##,##,##0;(#,##,##,##0)'  and when you do expand all format the number as  '#,##,##,##0;#,##,##,##0'

Not applicable
Author

Oh ok.

Here if the format is '#,##,##,##0;(#,##,##,##0) then negative values comes within braces else number right