Skip to main content

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Welcome to Qlik Community! Check out our new navigation! FIND OUT MORE
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.
Go-Anna
Contributor III
Contributor III
Author

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