Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
ionuttatu
Contributor II
Contributor II

Formula Help - That shows me the months available in format YYYYMM

Hi,

I would like to make a selection that lets me select a YYYYMM between 201701 and 201812 (Capture.PNG)

In my data I have a column for YEARMONTH starting with 201601 to 201812

This is the initial formula but it only shows me 201601 to 201612 and 201801 to 201812

=Concat({<YearMonth=-{'$(Year)'}>}distinct YearMonth,',')

$(Year) =year(today())-1&'*'

Can you help me understand the formula?

7 Replies
Anil_Babu_Samineni

This will return like

YearMonth

201601

201602

201705

201801

201811

201811

Concat(DISTINCT YearMonth, ',') -- It ignores the duplicate values

201601, 201602, 201705, 201801, 201811

Your expression work as Concat({<YearMonth -= {'$(Year)'}>} DISTINCT YearMonth, ',')

So, The variable year returns $(Year) =year(today())-1&'*' ------ It displays last year data which wildcard function like 2017* -- Wildcard data loading (*.blah......)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sunny_talwar

Not sure I understand completely, would you be able to share a sample and show your issue?

jonathandienst
Partner - Champion III
Partner - Champion III

As Anil pointed out, the variable is a match to all months in the current year

The expression is excluding everything in that match, so, 2016 and 2018 will be displayed and 2017 will be excluded.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
ionuttatu
Contributor II
Contributor II
Author

YearMonth -= {'$(Year)'}


so the '-' is excluding the values that are the same with last year

I think I get it now.

The formula is ok. But I need to change the $YEAR formula....annnnnnd.... now it works!

Thank you guys for the help.

Anil_Babu_Samineni

What you mean? to where you want to write?

The formula is ok. But I need to change the $YEAR formula....annnnnnd.... now it works!

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sunny_talwar

Since you got what you were looking for, please close the thread by marking correct and helpful responses.

Best,

Sunny

ionuttatu
Contributor II
Contributor II
Author

It's ok I understood the condition formula 

=Concat({<YearMonth=-{'$(Year)'}>}distinct YearMonth,',')


and the variable formula


$(Year) =year(today())-1&'*'


And I changed it to show me the info from 201701  to 201812