Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Expression result changes when using a dimension from a linked table

Hi all,

I have made a small example of the problem I'm running into:

This is my script:

Basis:
Load * Inline

[ID, Type, Selectie, Selectie2ID

0,1,A,1
1,1,A,1
2,1,A,1
3,2,A,1
4,2,A,1
5,3,A,1
5,3,A,1
5,3,A,1
5,3,A,1
6,1,B,2
7,1,B,2
8,1,B,2
9,2,B,2
10,2,B,2
11,3,B,2
12,3,B,2
13,3,B,2
14,3,B,2]; 


det:
load * inline
[Selectie2ID, Selectie2Name
1, A
2, B];

If I now create a chart where I use set statement to count the number of ID's based on their type and use "Selectie" as a dimension, it works as expected.

He shows me the amount of ID's that have type 1.

If I change this now and use "Selectie2Name" as a dimension, I would expect the same result. But he shows me a different graph.

The example qvw is attached.

Should there be an expression that works in both graphs or should I search for a different solution in the second graph?

What would be the solution for the second graph and also, why is there a difference ?

Tia !

1 Solution

Accepted Solutions
lironbaram
Partner - Master III
Partner - Master III

hei

attach is your answer

i changed the expression in the second chart to

Count({$<Type=-{1}>} ID)

View solution in original post

3 Replies
lironbaram
Partner - Master III
Partner - Master III

hei

attach is your answer

i changed the expression in the second chart to

Count({$<Type=-{1}>} ID)

Not applicable
Author

Hi, Thanks for the answer !

But the question I have now:

what is the difference between
count( {$ - <Type = {1}>} ID

and

count( {$ <Type = - {1} >} ID

Or is the first one just improper use of set statement?

lironbaram
Partner - Master III
Partner - Master III

hei

the first one exclude all the values of Type=1 in the model so as you have type=1 so now this values are excluded from the field value totaly,like they dont exists

the seconed one is the proper one