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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Straight table conditional value doesn't work

Hi,

I am trying to achieve the following:

I want to show records were two fields in the same record differs.

For this I am using a condtional validation construction like this:

=num(inc_Aantal_bon)<>num(inc_Antal_art)

so the fields compared are inc_Aantal_bon with inc_Antal_art when these differ I want to show them.

I put them on the dimension and on the expression as conditional value like this:

2016-05-01 17_59_27-QlikView x64 Personal Edition - [D__klant_Blokker_Qlikview_BRS_BRS_all.qvw_].png

2016-05-01 18_00_13-QlikView x64 Personal Edition - [D__klant_Blokker_Qlikview_BRS_BRS_all.qvw_].png

The result of this:


2016-05-01 18_00_32-QlikView x64 Personal Edition - [D__klant_Blokker_Qlikview_BRS_BRS_all.qvw_].png

So I got rows were both are equal. I played with it for hours but can't figure out why.

I hope you can help me.


John

2 Replies
sunny_talwar

I think you don't need a conditional statement. You need a calculated dimension here. Replace your dimension inc_BonNr with this:

If(Num(inc_Aantal_bon) <> Num(inc_Antal_art), inc_BonNr)

and make sure to select 'Suppress When Value Is Null' to suppress Null Value in dimensions

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

The Conditional option is to show or hide the expression column altogether. It operates at the chart level, not the row level.

This expression: =num(inc_Aantal_bon)<>num(inc_Antal_art) is a boolean test. It returns either true or false. And since it's not aggregated over a dimension it doesn't return anything.

Try using inc_BonNr as dimension and as expressions

  • Aantal bon: =if(inc_Aantal_bon <> inc_Antal_art, inc_Aantal_bon)
  • Aantal art: =if(inc_Aantal_bon <> inc_Antal_art, inc_Aantal_art)


Actually, a bit nicer is to not use the If statement at all, but another way to filter the relevant inc_BonNr values:

  • Aantal bon: only({<inc_BonNr={'=inc_Aantal_bon<>inc_Antal_art'}>}inc_Aantal_bon)
  • Aantal art: only({<inc_BonNr={'=inc_Aantal_bon<>inc_Antal_art'}>}inc_Aantal_art)

These kinds of statements are called set analysis expressions. The part {<inc_BonNr={'=inc_Aantal_bon<>inc_Antal_art'}>} selects only those inc_BonNr values where inc_Aantal_bon is not equal to inc_Antal_art.


talk is cheap, supply exceeds demand