Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

comparing data

hi all,

I've looked over the forum but didnt find the exact example for what I want,although that I found something similar

I coudn't manage to perform it... [:^)]

Pls look at the file. many user are comparing data between 2 or more periods/versions but what I'm looking for is that:

for example the user is selecting "version=1" and then the column data in the chart is changing according to his selections

BUT I need that the near by column (called 'to compare' ) will not change...well thats easy-set analysis...BUT the user want to select ANOTHER

period / version lets (say version=3) and that his selection will not effect column data but only effects the column 'to compare'.

Again,two selection -one is for the data and the other selection influence on the column 'to compare' only.

(the need is for comparing to the data that has selected before hope its clear..)

* I think that I need to add another column with the same values of version,but I'm not sure......

thants is advance

David

1 Solution

Accepted Solutions
Not applicable
Author

Hi David,

As you suggest, I believe it is best to create another field to select the comparison value. I did a few changes to your example, see attached.

  • There is a separate table for the second version field, version_2.
  • The chart uses set analysis to ignore the version selection in the second column, and use version_2 instead.

Hope this helps,

Hellmar

View solution in original post

8 Replies
Not applicable
Author

First, you can use Set Analysis to ignore the selection. On your second expressions, use:

sum({1} sales)


That will keep the second column the same regardless of your selection in version. Test that out and see how that works in your situation.

As for the second selection, you may have a few options. You may want to pull in the selection choices for the second selection, but make sure they are not linked to the rest of your data. Then when you make a selection for that second option, you could use a variable along with Set Analysis to filter the data.

Set your variable up as:

=GetFieldSelections(Selection2Field)


Then your Set Analysis on the second expression would become something like:

sum({1<Field = {$(=vVariable)}>} sales)


That Set Analysis function may need to be altered depending on what type of data you have (for example putting quotes around the dollar sign expansion for string values).

Not applicable
Author

Hi David,

As you suggest, I believe it is best to create another field to select the comparison value. I did a few changes to your example, see attached.

  • There is a separate table for the second version field, version_2.
  • The chart uses set analysis to ignore the version selection in the second column, and use version_2 instead.

Hope this helps,

Hellmar

johnw
Champion III
Champion III

If your actual case is as simple as the example, with just a version field that you want to be different between the columns, then I'd probably do what Hellmar suggests and have a version_2 field and use set analysis on it for the second column.

But I'm guessing that in the general case, where you instead want to compare a complicated selection of multiple values in multiple fields, this could be done most easily with one or more bookmarks. Using bookmarks, you can easily prepare two different sets to compare. Make selections for the first set and click a button to bookmark. Make selections for the second set, and you can easily compare to the bookmarked set using set analysis. If you want two different sets being compared, and yet a third set of selections for the rest of the reports, then two bookmarks.

Not applicable
Author

first-thanx everyone

Hellmar you got me right and your solution is great and working. Smile

John,your comment is logical and I will appreciate if you could add an example for it

in the file (version)

johnw
Champion III
Champion III

Gah, I figured you might ask for that. Embarrassed

See, I never touch bookmarks myself. I've never dealt with bookmarks in macros or in set analysis. So far, I can't seem to make the idea work, even if it seems sound to me.

I do seem to be able to save a bookmark:

sub AddToCompareBookmark
ActiveDocument.RemoveUserBookmark "ToCompare"
ActiveDocument.CreateUserBookmark "ToCompare"
end sub

But this doesn't seem to be making a user bookmark, but rather a server bookmark. I suppose that's fine, since supposedly server bookmarks are the replacement for user bookmarks. However, I can't seem to see server bookmarks, so it isn't doing me much good. I can manually create a user bookmark and name it the same thing. I can verify that the bookmark is there and working by simply clicking on it. But when I use it in a set analysis expression:

sum({BM01} sales)
sum({ToCompare} sales)

It doesn't return anything different than sum(sales). I assume I'm just doing something wrong, but that's about all the help I'm getting out of the help text for set analysis.

Anyone want to take a crack at this? It SHOULD be a trivial problem to solve.

johnw
Champion III
Champion III

Well, it turns out I'm not the only one having problems getting user bookmarks to work with set analysis. So for now, I've changed the example to use document bookmarks. It now demonstrates what I was suggesting. I do see one minor problem, which is that the chart doesn't refresh - QlikView apparently doesn't check for charts using bookmarks when a bookmark changes. I consider that a bug, but there's probably some easy workaround, some macro command to tell it to rebuild the chart.

prieper
Master II
Master II

Hi John
just tested and for me this works, provided you include your bookmark in "".

Peter

johnw
Champion III
Champion III

So you modified the user bookmark one to add double quotes, and it worked for you? Is this the change you made?

sum({"ToCompare"} sales)

Because that's not working for me either. Sad