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

remove multiple months

Hi All,

I have written the following code to get month in script

Date(Makedate((LEFT(Period,4)),(Right(Period,2)),01),'MMM') as Month

But i am getting repetitive months. like Jan,feb..dec again jan,,feb..dec

Can you please help me how to remove those.

5 Replies
JaMajka1
Partner Ambassador
Partner Ambassador

Hi Bharat,

could you please post an example and the result you want to have?

If you just need to derive month from date field you can use month(date#(Perion,'date_format')). https://help.qlik.com/en-US/qlikview/November2017/Subsystems/Client/Content/Scripting/DateAndTimeFun...

BR,

Maria

raman_rastogi
Partner - Creator III
Partner - Creator III

to look more Share values of Period Field.

johnca
Specialist
Specialist

Please provide samples of your raw data field "Period".

shiveshsingh
Master
Master

You can create a master calendar and link this field with calendar month and then show that calendar month n your listbox.

You are getting multiple months because due to makedate  different months are created for different records in your table Equipments_Details_final_12_Monoplane.

PS Your qvw file was not having any data, couldn't check the exact figures.

juraj_misina
Luminary Alumni
Luminary Alumni

Of course you get repetitive values, because those are different dates formated to similar format. Based on your script both 201801 and 201701 (and so on) will result in Jan, but they are different dates.

If you only want to have month value, then you can create master calendar table as suggested, or use

Month(Makedate((LEFT(Period,4)),(Right(Period,2)),01)) as Month