Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
sangeeth8787
Contributor III
Contributor III

Set Analysis and Concatenation

Hi,

 

I have a field Year-MonNu, when ever the user selects any particular date Eg: 06 June 2019, The year-Month Number field shows as 2019-06.

In a Pivot Chart, I have 5 expressions, 4 out 5 based on Date Selection, the 5th Expression need to retrieve the Year-MonthNu value based on Users Date Selection.

 

Date : 06 June 2019

Ideally I need to write set expression as  sum({<Year_MonthNo = '2019-06'}>}SalesAmount)

Eg: =  Sum({<Year-MonthNo = {"=$(Year(Date))" & "-" & =$(=Num(Month(Date))}}>}SalesAmount)

Could any help me how to retrieve the year and Month Number with concatenating '-' in set expression.

Many Thanks

Sangeeth

1 Solution

Accepted Solutions
sunny_talwar

May be this

=Sum({<[Year-MonthNo] = {"$(=Date(MonthStart(Max(Date)), 'YYYY-MM'))"}>} SalesAmount)

View solution in original post

2 Replies
sunny_talwar

May be this

=Sum({<[Year-MonthNo] = {"$(=Date(MonthStart(Max(Date)), 'YYYY-MM'))"}>} SalesAmount)
sangeeth8787
Contributor III
Contributor III
Author

Hi Sunny,

 

I am glad for your answer, It worked very well for me with small change in the expression you provided.

 

=Sum(Date = , {<[Year-MonthNo] = {"$(=Date(MonthStart(Max(Date)), 'YYYY-MM'))"}>} SalesAmount)

 

 

Thanks

Sangeeth