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: 
Chinnu3
Contributor III
Contributor III

Need to create a month column with date filed

Hi All

I have Updated_Date column and I need to create Month column based on the date column.

Updated_date Completed
5/2/2022 10
5/9/2022 15
5/16/2022 20
5/23/2022 25
5/30/2022 30
6/6/2022 35
6/13/2022 40
6/20/2022 45
6/27/2022 50

 

Requirement like I need to create a "Month_A1" column with last date in the month which is available in Updated_date column for example "Month_A1"

Base on Updated_date column I need to create Month_A1

in Month_A1 fields like

Month_A1
May-2022
Jun-2022

 

Final results be like 

Updated_date Completed Month_A1
5/2/2022 10  
5/9/2022 15  
5/16/2022 20  
5/23/2022 25  
5/30/2022 30 May-2022
6/6/2022 35  
6/13/2022 40  
6/20/2022 45  
6/27/2022 50 Jun-2022

If I select May-2022 in Month_A1 column I need to see only "Completed" as 30

I need this month column created in Script and in front end filter as well.

Thanks in advance.

Labels (6)
1 Solution

Accepted Solutions
Or
MVP
MVP

SET DateFormat='M/D/YYYY';
Table1:
LOAD date([Updated_date]) as [Updated_date], Completed INLINE [
Updated_date, Completed
5/2/2022, 10
5/9/2022, 15
5/16/2022, 20
5/23/2022, 25
5/30/2022, 30
6/6/2022, 35
6/13/2022, 40
6/20/2022, 45
6/27/2022, 50];
left Join
Load Monthname([Updated_date]) as Month,max(Completed) as Completed, max([Updated_date]) as Updated_date
Resident Table1
GROUP BY Monthname([Updated_date]);

Or_0-1656322874711.png

 

View solution in original post

6 Replies
Or
MVP
MVP

SET DateFormat='M/D/YYYY';
Table1:
LOAD date([Updated_date]) as [Updated_date], Completed INLINE [
Updated_date, Completed
5/2/2022, 10
5/9/2022, 15
5/16/2022, 20
5/23/2022, 25
5/30/2022, 30
6/6/2022, 35
6/13/2022, 40
6/20/2022, 45
6/27/2022, 50];
left Join
Load Monthname([Updated_date]) as Month,max(Completed) as Completed, max([Updated_date]) as Updated_date
Resident Table1
GROUP BY Monthname([Updated_date]);

Or_0-1656322874711.png

 

Chinnu3
Contributor III
Contributor III
Author

In Set expression I need to created a Month column by using updated_date column

for creating month, Condition for Month column is need to take  last date in Updated_date column in every month.

Or
MVP
MVP

Sorry, I don't understand what it is you're asking. My previous post contains the logic that you requested in your original post, though, and the output matches your final results output.

Chinnu3
Contributor III
Contributor III
Author

I want to add a filter which is Month. But I dnt have Month Column. I need to derive month Column from Updated_date column. but there is a condition, that is If I select any Month from month filter like May 2022 I want to see the data which should be there on that particular month(It should be like latest date in that particular month.

Example :- =date(floor(Monthend([updated_date])),'YYYY-MM-DD')

here will get end of the month date but I require in this Updated_date has whatever date is available in that each month last date if it is available dates

Chinnu3_0-1656344291457.png

I need to get the yellow marked dates in Month column rest no need. If I select that field(month) I need to filter in entire sheet with that.

thank you.

If you need more clarity then I will try again to explain in more detail.

Or
MVP
MVP

I don't understand what the difference is between your latest post and the solution already offered... it looks like the same thing to me.

Chinnu3
Contributor III
Contributor III
Author

Hi

I want  to increase this yellow marked ones font size and to make bold on those in a vertical bar chart

Chinnu3_0-1656941576270.png

thanks in advance...