Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have to do and/or operations in set analysis . Code is following:
Count(
{<CurrYear_flag={'Y'} , Prev1Year_flag={'Y'}, Prev2Year_flag={'Y'}>} +
{<CurrYear_flag={'Y'},Prev1Year_flag={'Y'},Prev2Year_flag -={'Y'}> }+
{<CurrYear_flag={'Y'},Prev1Year_flag -={'Y'},Prev2Year_flag={'Y'}>}
distinct ACCOUNT)
Can you please let me know right syntax to do this. only first set {<CurrYear_flag={'Y'} , Prev1Year_flag={'Y'}, Prev2Year_flag={'Y'}>} is working. Rest 2 are giving 0 in results. Prev2Year_flag -={'Y'} is not working I try individually. It has data Y, - . I am looking for not 'Y' data. It is not working with Prev2Year_flag ={'-'} too
Thanks,
Akanksha
My bad... once more change
Count({<ACCOUNT = {"=
(CurrYear_flag = 'Y' and Prev1Year_flag = 'Y' and Prev2Year_flag = 'Y') or
(CurrYear_flag = 'Y' and Prev1Year_flag = 'Y' and Prev2Year_flag <> 'Y') or
(CurrYear_flag = 'Y' and Prev1Year_flag <> 'Y' and Prev2Year_flag <> 'Y')"}>}
DISTINCT ACCOUNT)
First, I think you should use only a single set expression (single pair of {} )
Count(
{<CurrYear_flag={'Y'} , Prev1Year_flag={'Y'}, Prev2Year_flag={'Y'}> + <CurrYear_flag={'Y'},Prev1Year_flag={'Y'},Prev2Year_flag -={'Y'}> + <CurrYear_flag={'Y'},Prev1Year_flag -={'Y'},Prev2Year_flag={'Y'}>}
distinct ACCOUNT)
Not sure if the parts are ok. Do you maybe need to handle NULL (which may appear as '-' on different places)?
Ya I made it single pair now.
Can you please let me know in this case how will I check for null
How about this:
Count({<ACCOUNT = {"=
(CurrYear_flag = 'Y' and Prev1Year_flag = 'Y', Prev2Year_flag = 'Y') or
(CurrYear_flag = 'Y' and Prev1Year_flag = 'Y' and Prev2Year_flag <> 'Y') or
(CurrYear_flag = 'Y' and Prev1Year_flag <> 'Y' and Prev2Year_flag <> 'Y')>}
DISTINCT ACCOUNT)
<> 'and' doesn't work in set analysis
Have you tested this or are you talking from experience? From what I know they both do work as a search string in set analysis
Yes I tested it. Its showing error in set modifier
Missed a double quote and curly bracket at the end:
Count({<ACCOUNT = {"=
(CurrYear_flag = 'Y' and Prev1Year_flag = 'Y', Prev2Year_flag = 'Y') or
(CurrYear_flag = 'Y' and Prev1Year_flag = 'Y' and Prev2Year_flag <> 'Y') or
(CurrYear_flag = 'Y' and Prev1Year_flag <> 'Y' and Prev2Year_flag <> 'Y')"}>}
DISTINCT ACCOUNT)
Its giving 0 in result. I have pasted pic below. Seems like something wrong in brackets. last Closing bracket is not matching with red highlighted one's . Can you please check.
My bad... once more change
Count({<ACCOUNT = {"=
(CurrYear_flag = 'Y' and Prev1Year_flag = 'Y' and Prev2Year_flag = 'Y') or
(CurrYear_flag = 'Y' and Prev1Year_flag = 'Y' and Prev2Year_flag <> 'Y') or
(CurrYear_flag = 'Y' and Prev1Year_flag <> 'Y' and Prev2Year_flag <> 'Y')"}>}
DISTINCT ACCOUNT)