Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Share your agentic AI experience, learn from others, and earn a new badge: Put Agentic AI to Work
cancel
Showing results for 
Search instead for 
Did you mean: 
Qlik1_User1
Specialist
Specialist

Help needed on set expression

need help with set expression

Dim: Date in MMM-YY format

Measure Sum(salary),Count(ID)

But the trick over here is if date column has same month and year and has same Status than show sum of both date under that Month year.

DateSalaryIDStatus
3/1/2020101A
3/15/2020121A
4/1/2020232B
4/12/2020451B
6/29/2020891A
7/1/2020651A
8/1/2020781B

 

expected output

DateSalaryIDStatus
Mar-20222A
Apr-20683B
Jun-20891A
Jul-20651A
Aug-20781B

 

Please help!!

1 Solution

Accepted Solutions
Qlik1_User1
Specialist
Specialist
Author

created new date field

Date(monthstart(date),'MMM-YY')as newdate

so insight, the newdate field references to monthstart from the dedicated date.

View solution in original post

2 Replies
Channa
Specialist III
Specialist III


Main:
LOAD
"Date",
Text( Date("Date",'MMM-YY')) as DateY,
Salary,
ID,
Status
FROM [lib://TEST/Dates.xlsx]
(ooxml, embedded labels, table is Sheet1);

LOAD
DateY,Status,
sum(Salary) as Salary,
Count(ID) as ID

resident Main group by DateY,Status;

Channa
Qlik1_User1
Specialist
Specialist
Author

created new date field

Date(monthstart(date),'MMM-YY')as newdate

so insight, the newdate field references to monthstart from the dedicated date.