Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Nicole-Smith

Dollar Sign Expansion in Set Analysis

I've never been able to get this work the way I want it to, so I've always found a workaround, but now I'm really wondering what I need to do to make it work.

Say I have a bunch of stuff that is scored on a monthly basis.  If I look at it by month, I see the score for that month; however, if I look at it by quarter, I want to see the score for the latest month in that quarter.

I would expect that the set analysis in the following expression would work for this:

only({<Month = {'$(=max(Month))'}>} Score)

However, this expression returns the Score for the latest Month in all of the data, not the latest Month of the quarter (if my data is from Jan 2012 to Dec 2012, it only returns the Dec 2012 data, not Mar 2012, Jun 2012, Sep 2012, and Dec 2012).

Can anybody please help me out with this?  I hope it's something easy that I'm just overlooking...

Thanks for your help!

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Getting this to work with set analysis is more trouble than it's worth. You'll need an if statement (or pick-match combination) to create a different set for each quarter. Far easier is to add a table in the script

Report:

load Quarter as ReportQuarter, max(Month) as Month

resident ...tablewithmonthsandquarters...

group by Quarter;

Then you can use ReportQuarter instead of Quarter in your chart.


talk is cheap, supply exceeds demand

View solution in original post

4 Replies
Nicole-Smith
Author

I forgot to mention that Quarter is a Dimension on the chart for this.

CELAMBARASAN
Partner - Champion
Partner - Champion

Are you using MonthName to create Month field.

Try with this

Sum({<Month={"=Month=MonthName(QuarterEnd(Month))"}>} Score)

If possible try to create a flag to determine QuarterEnd month in script itself.

Gysbert_Wassenaar

Getting this to work with set analysis is more trouble than it's worth. You'll need an if statement (or pick-match combination) to create a different set for each quarter. Far easier is to add a table in the script

Report:

load Quarter as ReportQuarter, max(Month) as Month

resident ...tablewithmonthsandquarters...

group by Quarter;

Then you can use ReportQuarter instead of Quarter in your chart.


talk is cheap, supply exceeds demand
Nicole-Smith
Author

Thank you all for your responses!