Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
chris1987
Creator
Creator

Only within Only function and Set Anaysis in general

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

 

Labels (3)
1 Solution

Accepted Solutions
fosuzuki
Partner - Specialist III
Partner - Specialist III

Try this:

=only({<[MonthID]={$(=(only({1<DateID={$(=num(today())-1)}>}[MonthID])-3))}>}[MonthName])

View solution in original post

3 Replies
fosuzuki
Partner - Specialist III
Partner - Specialist III

Try this:

=only({<[MonthID]={$(=(only({1<DateID={$(=num(today())-1)}>}[MonthID])-3))}>}[MonthName])
jonathandienst
Partner - Champion III
Partner - Champion III

It might be as simple as this:

Only({<DateID = {$(=today()-1)}>} MonthName)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
chris1987
Creator
Creator
Author

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.