Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
joantbak
New Contributor III

Expression Formatting Bug?

I am using Expression formatting to change the colour of the result cell if it is the same as the highest ranked result.

I use the below Expression in the 'Background Colour' formatting box;

=IF(([Net Sales After Discount ]>=v.Exp.RecordBreakers.PreviousYear.ByMonth.Rank1.NetSalesAfterDiscount AND [Net Sales After Discount ]<=v.Exp.RecordBreakers.PreviousYear.ByMonth.Rank1.NetSalesAfterDiscount+1)

OR

([Net Sales After Discount ]>=v.Exp.RecordBreakers.CurrentYear.ByMonth.Rank1.NetSalesAfterDiscount AND [Net Sales After Discount ]<=v.Exp.RecordBreakers.CurrentYear.ByMonth.Rank1.NetSalesAfterDiscount+1)

,Green())


(using just 'if( X = Y ' does not give a result so 'if( X >= Y & X <= Y+1' has to be used....another quirk of Qlikview)


Now the above all works and the background changes to green for the first result as desired. The problem comes when I add 'Text Format' to make the result text Bold.  I use the same expression again but this time change the result to '<B>';


=IF(([Net Sales After Discount ]>=v.Exp.RecordBreakers.PreviousYear.ByMonth.Rank1.NetSalesAfterDiscount AND [Net Sales After Discount ]<=v.Exp.RecordBreakers.PreviousYear.ByMonth.Rank1.NetSalesAfterDiscount+1)

OR

([Net Sales After Discount ]>=v.Exp.RecordBreakers.CurrentYear.ByMonth.Rank1.NetSalesAfterDiscount AND [Net Sales After Discount ]<=v.Exp.RecordBreakers.CurrentYear.ByMonth.Rank1.NetSalesAfterDiscount+1)

,'<B>')


Being that this same statement worked for 'Background Colour' it follows it should work for 'Text format'  However it does not, instead it actually removes all formatting including the 'Background Colour' that was working?!?!


Is this just another Qlikview Bug?

1 Solution

Accepted Solutions
MVP & Luminary
MVP & Luminary

Re: Expression Formatting Bug?

The first issue isn't a bug else it are just Rounding Errors. This meant you need to use a rounding function to at least one part of the comparing, for example:

round([Net Sales After Discount ],0.01) = round([Net Sales After Discount ]>=v.Exp.RecordBreakers.PreviousYear.ByMonth.Rank1.NetSalesAfterDiscount,0.01)

The second issue with the text-formatting should normally work - I have done already multiple formattings like this and only seen such behaviour if anything was wrong whereby it might exists some conflicting because there are several ways of formatting a cell/row/column - per design- and visualization tab, with the here used attribute-expressions and per custom cell-format.

Also a corrupt object (pivot in this case) is quite rarely but possible. One way to check for it is to create a new pivot and add some dummy dimension/expression and format it without this expressions/conditions and if the formattings will be applied add then step by step your real dimensions and expressions (should be there any conflict you will see it at once).

- Marcus

1 Reply
MVP & Luminary
MVP & Luminary

Re: Expression Formatting Bug?

The first issue isn't a bug else it are just Rounding Errors. This meant you need to use a rounding function to at least one part of the comparing, for example:

round([Net Sales After Discount ],0.01) = round([Net Sales After Discount ]>=v.Exp.RecordBreakers.PreviousYear.ByMonth.Rank1.NetSalesAfterDiscount,0.01)

The second issue with the text-formatting should normally work - I have done already multiple formattings like this and only seen such behaviour if anything was wrong whereby it might exists some conflicting because there are several ways of formatting a cell/row/column - per design- and visualization tab, with the here used attribute-expressions and per custom cell-format.

Also a corrupt object (pivot in this case) is quite rarely but possible. One way to check for it is to create a new pivot and add some dummy dimension/expression and format it without this expressions/conditions and if the formattings will be applied add then step by step your real dimensions and expressions (should be there any conflict you will see it at once).

- Marcus