Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
maximiliano_vel
Partner - Creator III
Partner - Creator III

Using a dimension value in set analisys

Hello,

I have two tables that are not linked.

Table1:

  

Col1Col2MatchCod
AA1'4102*','4110*'
AA2'4104*','4107*','4108*'
AA3'4105*','4106*'
BB14101*'
BB2'4115*'
BB3'4117*','4119*'

Table2:  

CodValue
41012424
4101013190
4101021718
4101020011770
41022175.00
4102022133.00
41033236
41042294
4104043455
41053371
41061854
41071718
4107013666
41083481
4108013060
4108010012408
41091682
41103817.00
41113446
41122511
41133746
41143400
41152070
41163295
41173388
4117013157
411710013194
41182267
41193101
41202617
41212943
41221620

I need to create a pivot table so the results depends on the MatchCod Dimension. Something like

=Sum({<Cod={$(=Only(MatchCode))}>} Value)

The results should be:

   

Col1Col2MatchCod=Sum({<Cod={$(=Only(MatchCode))}>} Value)
AA1'4102*','4110*'8125
AA24104*','4107*','4108*'20082
AA3'4105*','4106*'5225
BB14101*'9102
BB2'4115*'2070
BB3'4117*','4119*'12840

The formula above, only works when i select an specific row, I need this to work with no selections.

Please advice

Regards

1 Solution

Accepted Solutions
Peter_Cammaert
Partner - Champion III
Partner - Champion III

That's not the way to do it, because a data set specified by set analysis will be assembled before the object (a table in your case) is recalculated. The result will be that in the set analysis spec, Only(MatchCode) will try to return all active MatchCode values, which results in a NULL value.

If a single value in a table has to match a code range, why not do this in your script using WildMatch() ?

View solution in original post

1 Reply
Peter_Cammaert
Partner - Champion III
Partner - Champion III

That's not the way to do it, because a data set specified by set analysis will be assembled before the object (a table in your case) is recalculated. The result will be that in the set analysis spec, Only(MatchCode) will try to return all active MatchCode values, which results in a NULL value.

If a single value in a table has to match a code range, why not do this in your script using WildMatch() ?