Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi there,
ı have a table like that :
ID | YEAR_MONTH | category | money |
3969385 | 201502 | car | 1.206 |
3969385 | 201506 | bus | 2.455 |
28289815 | 201502 | x | 610 |
22291674 | 201506 | car | 1.224 |
23481102 | 201506 | t | 563 |
10126853 | 201508 | bus | 445 |
360150 | 201503 | r | 1.231 |
1631437 | 201511 | w | 523 |
ı want to filter ID s like that :
Display ONLY the ID that includes BOTH category = "car" and "bus"
( here the answer is ID='3969385' that is the one includes both, there are other ID that only inclues one of them that is useless for us)
Anyone can help? thank you.
May be this
Sum({<ID = {"=Count(DISTINCT {<category = {'car', 'bus'}>} category) = 2 and Only({<category = {'bus'}>} YEAR_MONTH) > Only({<category = {'car'}>} YEAR_MONTH)"}>} money)
or this
Sum({<ID = {"=Count(DISTINCT {<category = {'car', 'bus'}>} category) = 2 and Max({<category = {'bus'}>} YEAR_MONTH) > Max({<category = {'car'}>} YEAR_MONTH)"}>} money)
The problem is that you are sharing a very small set of data and it is difficult to know what you might need based on your complete data set....
yes it worked! my friend. Thank you for your effort.
Awesome ... Consider marking any helpful responses for future visitors.
Best,
Sunny