Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Morning,
I wondered if anyone can help with this function. I'm trying to embed an only() within an only() to get the correct MonthName.
I'm trying to first select the MonthID of todays date, minus 3 months, which is 24229. I can get this by using the following function:
=only({1<DateID={'$(=num(today())-1)'}>}[MonthID])-3
I now want to get the MonthName which is associated to this MonthID, so I'm trying to embed the Only() function within another:
=only({<[MonthID]={$("=only({1<DateID={'$(=num(today())-1)'}>}[MonthID]-3"))}>}[MonthName])
But this is producing an error.
Please can someone help me correct the above, but it would also be very helpful if you could also point me in the direction of some documentation about how to hand functions in set anaysis. I'm self taught in Qlikview and always end up asking where to put the $ or whether to use "" or '. The functions aren't an issue to me, it's the syntax! It would be good to have an understanding of how these work
Cheers
Chris
Try this:
=only({<[MonthID]={$(=(only({1<DateID={$(=num(today())-1)}>}[MonthID])-3))}>}[MonthName])
Try this:
=only({<[MonthID]={$(=(only({1<DateID={$(=num(today())-1)}>}[MonthID])-3))}>}[MonthName])
It might be as simple as this:
Only({<DateID = {$(=today()-1)}>} MonthName)
Thanks,
I actually got it figured out but using:
=only({1<[MonthID]={$(=only({1<DateID={'$(=num(today())-1)'}>}[MonthID]-3))}>}[MonthName])
Thinking that I needed the apostrophe, but after testing your code I didn't
Thanks again for the reply.