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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Straight Table Set Analysis to isolate a month

I have a straight table where I want to have the sum of sales for a year in one column and in the next column I want just the month of Dec sales.

Consider a table like this:

Part     Month     Year     Sales

In the straight table my Dimension is Part.  Then I have a column Annual Sales where I have an expression like sum(<{Year={'2016'}>}Sales).  When I try to isolate one month via set analysis it will not work.  have tried sum(<{Year={'2016'},Month={'Dec'}>}Sales) with no luck.  Any suggestions?

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Ok so I figured it out but not exactly sure why it works.  In the set analysis I used Month={"*Dec*"}.  Not sure why simply 'Dec' itself does not work.  If anybody knows I would be interested to understand why.  Thanks

View solution in original post

5 Replies
Not applicable
Author

Hello,

Try It

SUM({

  $<Year = {2016}, Month = {'Dec'}>

}

Sales) !

Nicole-Smith

If you copied this directly from your QVW, your syntax for the beginning of the set analysis is off.


You have:

sum(<{Year={'2016'}>}Sales)


Should be:

sum({<Year={'2016'}>}Sales)


Anonymous
Not applicable
Author

sorry, you are correct - and I did not copy it, just typed it wrong

Anonymous
Not applicable
Author

So I see how this works in your example but for some reason its not working in my data set.  I do have other identifiers in the data that I'm isolating as well besides Month.  I just gave that as an example as I thought the answer would work regardless.  So if you had more than one item in your set analysis that is attempting to isolate the month of Dec and say (for sake of example) currency.  And assume the database has sales in 2 different currencies for each month.  So I want to isolate currency USD, Year 2016 and month Dec.  Not sure why that would matter but there must be something to it.

Anonymous
Not applicable
Author

Ok so I figured it out but not exactly sure why it works.  In the set analysis I used Month={"*Dec*"}.  Not sure why simply 'Dec' itself does not work.  If anybody knows I would be interested to understand why.  Thanks