Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
WorkFish
Contributor II
Contributor II

show month(format:MM) as dimension but can not distinguish if exists like' 202205' '202305'

hi guys

i have a month dimension which format is 'MM',for example when date='2022-05-31' then month ='05'

so when i choose date like between '2021-05-14' and '2022-05-20'

it will only shows one '05',data which date ='2021-05*'or '2022-05*'  have merged into one and that's not what i want .

i know i can write a year() &month(),but requirments is just month,so if there is someway can realize this requirment

thanks very much 

2 Solutions

Accepted Solutions
marcus_sommer

You may create your field in this way:

dual(date(DATE, 'MM'), year(DATE)*100+month(DATE)) as MM

- Marcus

View solution in original post

MarcoWedel

Date(MonthStart(date),'MM')

View solution in original post

6 Replies
abhijitnalekar
Specialist II
Specialist II

Hi @WorkFish,

Can you please explain your scenario with the data? 

Regards,
Abhijit
keep Qliking...
Help users find answers! Don't forget to mark a solution that worked for you!
WorkFish
Contributor II
Contributor II
Author

 

WorkFish_0-1653980799830.png

i upload a picture that can see when time from 2021-05-12 to 2022-05-12,

month should be shown as 05 06 07 08 09 10 11 12 01 02 03 04 05

but because of dimension  [month(date) ] ,the data of May 2021 and May 2022 have been combined in '05'column

is there any method to make them seperated,like this :05 06 07 08 09 10 11 12 01 02 03 04 05

marcus_sommer

You may create your field in this way:

dual(date(DATE, 'MM'), year(DATE)*100+month(DATE)) as MM

- Marcus

WorkFish
Contributor II
Contributor II
Author

😆

Thank you Marcus, this is what i want!

MarcoWedel

Date(MonthStart(date),'MM')

WorkFish
Contributor II
Contributor II
Author

Hi  @MarcoWedel 

I tried ,it also works.

Thank you!