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: 
googel84
Partner - Creator III
Partner - Creator III

Expressions and data islands

Hi community, I cannot understand why the expression I used in the second table does not work...

The first works and I can get to the desired result but it is less efficient as it is actually evaluates a sort of cartesian product of the fields mentioned in the "if".

Thanks in advance.

2 Replies
fkeuroglian
Partner - Master
Partner - Master

Hi Alberto, see the attached image

you want to connect a data island with the table?, the first chart will be ok because in your model they are connected but if you see you dont have any connection with the table you put in the expression

there is no relation between [Last 13 Rolling Months - Date %] and  [Reference date]

good luck

googel84
Partner - Creator III
Partner - Creator III
Author

Thanks Fernando,

the same thing happens in the first table as the link is provided through the "if" statement within the expression:

Expression in table 1

count( DISTINCT { $<[Fact subtype] = {'KRI13'}, [Last 13 Rolling Months - Period %]= > }

  if ( [Last 13 Rolling Months - Period %] = REFERENCE_DATE.Period and [Amount class code %] = [Amount class code], [Buyer code] )

)

Expression in table 2

count( DISTINCT { $<[Fact subtype] = {'KRI13'}, [Last 13 Rolling Months - Period %]= > }

  if ( [Last 13 Rolling Months - Date %] = [Reference date] and [Amount class code %] = [Amount class code], [Buyer code] )

)

In both cases the condition involves a field of REFERENCE_DATE and a field of LAST_13_ROLLING_MONTHS_%; the first works, while the second does not.