JOIN/COLLECT combined with 2 IF statements
Answers
-
Good eye, @KDM there was an extra space. Now, both of them say INVALID OPERATION.
If this does not work, maybe I could create a helper column to bring over the date, thus I don't have to go out to the other sheet and get it.....I would make it easier without the helper column.
Any other ideas that you may have?
Thanks, Barbara
-
if you remove the whole IF clause for now, does the first JOIN formula work - the one without any dates
-
Yes, @KDM, this portion works:
JOIN(COLLECT({DAX Ambient Inventory Install Location}, {DAX Ambient Inventory Project #}, [Project Number]@row), ", "))
It also works with adding IF: =IF([Project Number]@row <> "", JOIN(COLLECT({DAX Ambient Inventory Install Location}, {DAX Ambient Inventory Project #}, [Project Number]@row), ", "))
But once I add the COUNTIF, then I get the INVALID OPERATION.
-
Looking at your data set for the specific project number the formula is testing - is there any dates that are in the past? I'm wondering if the error is just associated with this one row because it has no past dates?
-
Good thinking, @KDM, I added an install date in the past and one in the future and no install date - same results.
I know this must be frustrating for you, too.
Maybe we should just pick the date up from the same spreadsheet via a helper column and then JOIN/COLLECT from the other sheet.
Thoughts?
-
we can do that. An INDEX/MATCH should be able to pull it in for you. I'm also agreeable to zoom if needed
-
Add this to the TODAY() part
@cell<=DATE(TODAY())
-
Mhm, I get an INCORRENT ARGUMENT on either scenarios.
Like this?
=IF([Project Number]@row <> "", JOIN(COLLECT({DAX Ambient Inventory Install Location}, {DAX Ambient Inventory Range Install Date}, @cell = <DATE(TODAY()), {DAX Ambient Inventory Project #}, [Project Number]@row), ", "))
Then I thought I maybe try TODAY=>@cell({DAX Ambient Inventory Range Install Date}) - but no luck. I tried to mirror the example from the formula spreadsheet.
-
remove the @cell in front of the =<TODAY()
I got that to work in my test sheet
=IF([Project Number]@row <> "", JOIN(COLLECT({DAX Ambient Inventory Install Location}, {DAX Ambient Inventory Range Install Date}, =<TODAY(), {DAX Ambient Inventory Project #}, [Project Number]@row), ", "))
-
@KDM , I am giving up. I know you have been working hard on this one for several days now, so have I. It will not work for me.
=IF([Project Number]@row <>"", JOIN(COLLECT({DAX Ambient Inventory Install Location}, {DAX Ambient Inventory Range Install Date}, =<TODAY(), {DAX Ambient Inventory Project #}, [Project Number]@row), ", "))
Let's go with plan B and use a helper column, which brings the date onto the spreadsheet and we only have to go out to the inventory sheet for the locations.
I know its frustrating.....
-
Sounds like a plan. Are you comfortable setting up the INDEX/Match to get the date. I think it's a Match and not a Collect. Let me know if you need help.
-
And because it's hard for me to let a puzzle go, I tried one more thing in my test sheet.
=JOIN(COLLECT({Test Sheet Locations}, {Test Sheet Date}, AND(@cell <= TODAY(), ISDATE(@cell)), {Test Sheet Project Number}, [Project Number]@row), ", ")
it worked for me.
-
You are too funny, Kelly @KDM. I want to figure this out, too....
I know this formula is working (it just does not consider a date in the past):
=IF([Project Number]@row <> "", JOIN(COLLECT({DAX Ambient Inventory Install Location}, {DAX Ambient Inventory Project #}, [Project Number]@row), ", "))
I tried to replace the empty project number criteria, with the date criteria, but it does not like it:
=IF({DAX Ambient Inventory Range Install Date} @cell < TODAY(), JOIN(COLLECT({DAX Ambient Inventory Install Location}, {DAX Ambient Inventory Project #}, [Project Number]@row), ", "))
Now, lets try without the IF:
=JOIN(COLLECT({DAX Ambient Inventory Install Location}, {DAX Ambient Inventory Project #}, [Project Number]@row), ", ") - it's working, but it picks up locations for projects, that have no project number
Now, let's try with just one Date criteria:
=JOIN(COLLECT({DAX Ambient Inventory Install Location}, {DAX Ambient Inventory Range Install Date}, @cell = <TODAY(), {DAX Ambient Inventory Project #}, [Project Number]@row), ", ") - INVALID
With the other Date criteria:
=JOIN(COLLECT({DAX Ambient Inventory Install Location}, {DAX Ambient Inventory Range Install Date}, ISDATE(@cell), {DAX Ambient Inventory Project #}, [Project Number]@row), ", ") - yes, it's working
Let's try together with AND:
=JOIN(COLLECT({DAX Ambient Inventory Install Location}, {DAX Ambient Inventory Range Install Date}, AND(ISDATE(@cell), @cell <= TODAY()), {DAX Ambient Inventory Project #}, [Project Number]@row), ", ") - yes, it's working.
Maybe the date criteria was not working, because I had the <= the other way around.
Bottom line, Kelly, your endurance is phenomenal and your dedication is unlimited. Thank you, thank you, thank you.
Sincerely, Barbara
-
Man. I should have caught that for you. Yes the less than equal in wrong order would have done it. The equal sign is always last
I’m glad we got it working
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.6K Get Help
- 433 Global Discussions
- 136 Industry Talk
- 465 Announcements
- 4.9K Ideas & Feature Requests
- 143 Brandfolder
- 147 Just for fun
- 63 Community Job Board
- 466 Show & Tell
- 32 Member Spotlight
- 2 SmartStories
- 298 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!