Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
17George
Contributor II
Contributor II

Format the number part of dual()

Hello,
I'm using dual(value, fabs(value)) as expression in QlikView to display the average value and keep the negative numbers visible but I would like, if possible,  to format the results with 1 decimal place instead of 12. 

dual.jpg
(comma as decimal separator)

Is it somehow possible?
Regards

 

Labels (1)
11 Replies
17George
Contributor II
Contributor II
Author

@marcus, I created a new table with one dimension and the expression avg(aggr(avg(Value), Dim1)) but a mix of positive/negative numbers, without fabs(), returns always an incorrect result - see  screenshot.
d4.jpg

marcus_sommer

The calculation itself is correct. If you want another calculation you may just add the fabs() or other stuff to modify it.

Further it might be that you need different calculations for the different levels, like:

if(dimensionality() = 0, expr1, expr2)

Also thinkable is to wrap the above mentioned aggr() approach with another aggr() to react differently to the levels. But such an approach gets easily complex and by larger data-sets slow.

Therefore I suggest to consider if other views on the information may not also possible and/or even more expedient, for example to use a second column to show the positive/negative information and/or a coloring. 

- Marcus