Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I have a table
Year Month Invoice Number
2001 | Jan | 1 |
2001 | Feb | 2 |
2001 | Mar | 3 |
2001 | Apr | 4 |
2002 | Feb | 5 |
2002 | Mar | 6 |
2002 | June | 7 |
2002 | May | 8 |
2003 | June | 9 |
2003 | July | 10 |
2003 | Aug | 11 |
2003 | Sep | 12 |
2003 | May | 13 |
2003 | Apr | 14 |
I have two text boxes and within that I have the following two expressions:
1. =count({$<Year = p({State1}Year)>} DISTINCT [Invoice Number]) and
2. =count({$<Year = State1::Year>} DISTINCT [Invoice Number])
And then I have One list box with Year field and it is in State 1 and another List Box with Month field and it is in default state.
While selecting values from either from Year List Box and Month List Box, I am getting the same value for both the expressions. Can someone help me with this? What is the difference between these two expressions and why I am getting the same value for both the expressions?
But from the help document:
The difference between the expressions is that in the first one, the possible values on invoice number from State1 are passed into the default state. In the second expression, the selected values from State1 are passed into the default state. If the user has not made any invoice number selections in State1, no invoice number values will be passed into the default state.
Thanks,
Karthick S
My bad, I missed State1 reference in the second expression. the difference between the two expression is as follows
1) =count({$<Year = p({State1}Year)>} DISTINCT [Invoice Number]) and
If you happen to have another filter in state1 such as Month and if you select June in your sample, we only have 2002 and 2003 available for selection. At this time this expression will give 10.
2) =count({$<Year = State1::Year>} DISTINCT [Invoice Number])
Same selection as above will continue to show 14
Can you share a sample where it shows that selection in alternate state is giving the same output for the two expression when you make a selection in Year field? I think Month field giving same output make sense, but Year field selection doesn't make sense. I think it should give different output based on selection in Year field.
Sunny,
I have attached the document. Please have a look at that.
According to you, how that two expression should work differently? Please explain
My bad, I missed State1 reference in the second expression. the difference between the two expression is as follows
1) =count({$<Year = p({State1}Year)>} DISTINCT [Invoice Number]) and
If you happen to have another filter in state1 such as Month and if you select June in your sample, we only have 2002 and 2003 available for selection. At this time this expression will give 10.
2) =count({$<Year = State1::Year>} DISTINCT [Invoice Number])
Same selection as above will continue to show 14
Sunny,
I understand now. Thanks for your explanation.
=count({$<Year = p({State1}Year)>} DISTINCT [Invoice Number])-- This expression is not explicit to Year field selection. So either selecting Month or Year , the expression value changes
whereas the second expression,
=count({$<Year = State1::Year>} DISTINCT [Invoice Number]) -- This is explicit to Year field. The value changes only for Year field and the value does not change for any selection in Month field.