Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis - implied fields and dimensions

Hi All,

Hopefully a quick one.

I have 2 graphs stacked on above the other - both working out sales with a simple flag field set to qualify.

The bottom is simple and dimension is region so I've used:  Sum ( { < Flag = {1}> } Sales) - this works fine.

The one above has months as a dimension but I would like to retian the whole calendar year, however must be able to run region selection (so see region sales over calendar year) - which I cant seem to get??

Am currently using: Sum ( {1<Flag = {1},  Cal_Year={$(vCurrentYear) }  >} Sales)

As it stands this retains the entire year, bhoever the top graph (time dimension) is not affected by the selection of a region??

Pretty new at this so help much appreciated and any tips / pointers would be welcomed!!

Cheers!

5 Replies
Not applicable
Author

Hi,

     As per the scenario here, all you need is to have 'Month' as your first dimension and 'Region' as the second dimension in your chart. Then use the same expression as in your lower chart i.e Sum ( { < Flag = {1}> } Sales). As in ur expression : Sum ( {1<Flag = {1},  Cal_Year={$(vCurrentYear) }  >} Sales)

The 1 here specifies full set of all records in the expression. You may then provide listboxes for Year and Region selection as well. Hope this helps.

PFA: Sample.qvw (Just an example for this scenario).

Not applicable
Author

Hi barronfly!

Sum ( {1<Flag = {1},  Cal_Year={$(vCurrentYear) }  >} Sales)

see the '1' which i hv made bold in ur text.

Becz of this '1' ,ur expressions will not be affected by the selections u make in the list box.

And since u r taking region in the list box ,so when u selct any region ..it is not affcting the data in ur chart.

u hv to remove it...if u want ur exprssions to get affected by the selections u make in list box.For more detail u can refer Set analysis in Help option.

Not applicable
Author

Hi Erika / Lawrence ,

Thank you for the replies – your explanations do make sense and I’m seeing the error in my ways

Does raise 2 questions though.

Firstly then, the problem with my expression is that I am applying the 1<> to Flag={1}, howecer Flag={1} should be part of the base function (Sum of Sales where Flag = 1).

So what would be correct syntax then to correct this? Have tried a number of permutations but can’t seem to get it?

Secondly, I have now done away with the flag altogether and read this straight in through the script as Clean_Sales**. Then I have nicked a string of script for my expression that works to a degree, as follows:

Sum ({$<Cal_Year={$(vCurrentYear)},Cal_Month=>} Clean_Sales)

This works to exclude any selection in of month from my calendar month, which is what I want. However, how do I exclude Quarter and week from calendar selection also?

**I used the clean_sales as I was unable to apply both the $<> and the flag reference – as in the first question above.

Not applicable
Author

Ich werde ab 05.09.2011 nicht im Büro sein. Ich kehre zurück am

23.09.2011.

Ich werde Ihre Nachrichten nach meiner Rückkehr beantworten.

Diese E-Mail kann Betriebs- oder Geschäftsgeheimnisse oder sonstige vertrauliche Informationen enthalten. Sollten Sie diese E-Mail irrtümlich erhalten haben, ist Ihnen eine Verwertung des Inhalts, eine Vervielfältigung oder Weitergabe der E-Mail ausdrücklich untersagt.

Bitte benachrichtigen Sie uns und vernichten Sie die empfangene E-Mail. Vielen Dank!

Not applicable
Author

Hi,

     You may use:

Sum ({1<Cal_Year={$(vCurrentYear)}>} Clean_Sales)

'1' here specifies full set of all records in the application. So this would ignore any selections in Month, Quarter and Week. Hope this helps.

Thanks.