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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Frédéricdh
Creator II
Creator II

Set Expression

Hello,

 

Can I write this things:

= If((YEAR(JWX) *100 + Week(JWX))<=Year(Addmonths(Today(1),-1) )*100 + Week(Addmonths(Today(1),-1)),Sum({<ORT={'C sonstige Orten'}>*<(YEAR(JWX) *100 + Week(JWX))={"<=$(=(Year(Addmonths(Today(1),-1) )*100 + Week(Addmonths(Today(1),-1)))) " }>} TOTAL BLEGW),Sum({<ORT={'C sonstige Orte'}>}BLEGW))

 

Labels (1)
4 Replies
pedrohenriqueperna
Creator III
Creator III

Hi,

I'm not really sure about the expression purpose, but if JWX is a field in your data model, yes, you can use it inside Year and Week function, if JWX holds number values.

rubenmarin1

Hi, in the same table where JWX is (or in a calendar table) you can create a field like:

YEAR(JWX) *100 + Week(JWX) as YearWeek

And use YearWeek field in set analysis

anat
Master
Master

better to create a field in load script by using the same logic then call that field in set expression.

YEAR(JWX) *100 + Week(JWX) as Week_field

 

= If(Week_field<=Year(Addmonths(Today(1),-1) )*100 + Week(Addmonths(Today(1),-1)),Sum({<ORT={'C sonstige Orten'}>*<Week_field={"<=$(=(Year(Addmonths(Today(1),-1) )*100 + Week(Addmonths(Today(1),-1)))) " }>} TOTAL BLEGW),Sum({<ORT={'C sonstige Orte'}>}BLEGW))

Frédéricdh
Creator II
Creator II
Author

thanks you