Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
wandapec
Partner - Contributor III
Partner - Contributor III

Inconsistent Num() Formatting on Income Statement

I have a model displaying an Income Statement. The following expression displays the P&L and uses the Num() format of MinString(Format). Format is a field in an Excel spreadsheet for each line of the Income Statement and is R#,##0;(R#,##0), so an example would be:

wandapec_1-1620895661955.png

Expression:

if([Exec P&L Level] = 's','',
Num(
(Sum({$}Amount))
/fabs(if(Flag=1, $(=Sum({$}SalesAmount)),if(Flag=2, $(=Sum({$}GPAmount)), 1)))
, Minstring(Format))
)

For some reason, and I can't work out the pattern, it sometimes doesn't apply the formatting. Check the Income Tax line in the image below. In the example below, I have selected YTD Jan to Apr. When I select YTD Jan to Mar or Feb, it works fine...

E.g. Jan to Apr

wandapec_2-1620895765157.png

E.g. Jan to Mar

wandapec_4-1620896217410.png

Any ideas? Thanks.

 

Labels (1)
1 Solution

Accepted Solutions
wandapec
Partner - Contributor III
Partner - Contributor III
Author

Thanks Gysbert. 
I eventually found the problem. If there is not transaction for the relevant GL Code in the particular month that you have selected, i.e. items are greyed out in a list box, then it doesn't know what format to use for any historical transactions showing in the chart. I will disconnect the calendar from the transaction and use a variable to reference the relevant month selected... Hopefully that will work....

View solution in original post

2 Replies
Gysbert_Wassenaar

Add a text object and put Minstring(Format) in it. Then make your date selections to check if Minstring(Format) always returns what you expect.


talk is cheap, supply exceeds demand
wandapec
Partner - Contributor III
Partner - Contributor III
Author

Thanks Gysbert. 
I eventually found the problem. If there is not transaction for the relevant GL Code in the particular month that you have selected, i.e. items are greyed out in a list box, then it doesn't know what format to use for any historical transactions showing in the chart. I will disconnect the calendar from the transaction and use a variable to reference the relevant month selected... Hopefully that will work....