Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
Go-Anna
Contributor III
Contributor III

Formula with SET expression

Hi!

Do we have any detectives who can work out what is wrong with my formula?

=Sum({<ExEmployee={'YES'}, [DataType]={'Actual'}, YTDFlag={1} ,Period={">=Date(MakeDate(LEFT([Last day of Employment],4),MID([Last day of Employment],6,2)),'YYYYMM')"}>}[Price (SEK)])

 

I keep getting zero!

Go-Anna_0-1606382954643.png

 

5 Replies
Primrose
Contributor III
Contributor III

Have you tried with YTDFlag={'1'}?

tresesco
MVP
MVP

@Go-Anna 

Try like:

=Sum({<ExEmployee={'YES'}, [DataType]={'Actual'}, YTDFlag={1} ,Period={">=$(=Date(MakeDate(LEFT([Last day of Employment],4),MID([Last day of Employment],6,2)),'YYYYMM'))"}>}[Price (SEK)])

Go-Anna
Contributor III
Contributor III
Author

That really worked Tresesco! But........only when I have selected one (and only one) [Last Day of Employment] date. Is it possible to see the price without selecting a [Last Day of Employment]  date or if I select a number of dates??? Thanks.

 

PrashantSangle

use min() or max() or maxstring() or minstring() for that..

 

=Sum({<ExEmployee={'YES'}, [DataType]={'Actual'}, YTDFlag={1} ,Period={">=$(=Date(MakeDate(LEFT(minstring([Last day of Employment]),4),MID(maxstring([Last day of Employment]),6,2)),'YYYYMM'))"}>}[Price (SEK)])

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Go-Anna
Contributor III
Contributor III
Author

Thank you PrashantSangle I will work on it and see if I can get it to work 🙂