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: 
qlikster
Contributor III
Contributor III

Combine outer set analysis as Master Item with another expression that is defined as a Master Item

Hi,

I'm trying to combine a pre-defined Outer Set Analysis with a pre-defined expression.

 

I have variables in the script:

MasterItem1

{<Year={'$(vMaxYear)'},Month={'$(vMaxMonth)'},Day={'<=$(vMaxDay)'},Date=,YearMonth=>}

MasterItem2

Sum(distinct {<EVENT_TYPE = {Sales}>} Sales)

This is what I want to use as an expression but it doesn't work:

[MasterItem1]
[MasterItem2]

 

But this does work:

{<Year={'$(vMaxYear)'},Month={'$(vMaxMonth)'},Day={'<=$(vMaxDay)'},Date=,YearMonth=>}

Sum(distinct {<EVENT_TYPE = {Sales}>} Sales)

 

Any idea why?

Labels (2)
1 Solution

Accepted Solutions
mikeharing72
Contributor
Contributor

Interesting approach! Combining outer set analysis with another expression defined as a Master Item can lead to deeper insights and herb grinder enhanced data analysis. Excited to see the results of this innovative method in action. Keep up the great work.

View solution in original post

7 Replies
qlikster
Contributor III
Contributor III
Author

I managed to solve it.

Just use dollar sign expansion on the first MasterItem:

$([MasterItem1])
[MasterItem2]

qlikster
Contributor III
Contributor III
Author

Was to quick to think I had a working solution.

That didn't play so I'm still open for suggestions/help

 

Vegar
MVP
MVP

I'm not sure if you can treat master items as variables. Consider storing your SET modifiers as variables and not master items.

Then you could do this.

=$(var_this_week_2_date) [Masteritem2]

qlikster
Contributor III
Contributor III
Author

Too bad,

would be great to set up a few vMasterItems for reusability . 

The variable overview and editing is not very well implemented.

 

But thanks for the reply. I'll set the variables in the script and then use them in the Master Items.

 

Weird though, this almost worked (dollar sign expansion on the variable Master Item), I got results but didn't work when I wanted to check previous month :

$([MasterItem1])
[MasterItem2]

 

 

$(vMaxMonth)-1

 

 

Vegar
MVP
MVP

It is a bit hard to advice when there are multiple layers of variables in play. 

What does $(vMaxMonth) return? What does $(vMaxMonth)-1 return?  Could it be that your set are expecting a string value 'Jan', 'Feb', etc... and your $(vMaxMonth)-1 returns a integer like 1,2,...?

How do you handle when vMaxMonth is January? 

marcus_sommer

I suggest to re-think the entire approach because combining and/or nesting multiple expression-parts per master-items and/or variables could become the complete opposite to the aim of simplifying the handling. IMO it's only sensible for a few really redundant and/or rather quite complex expressions but not as a general approach.

mikeharing72
Contributor
Contributor

Interesting approach! Combining outer set analysis with another expression defined as a Master Item can lead to deeper insights and herb grinder enhanced data analysis. Excited to see the results of this innovative method in action. Keep up the great work.