# New to Qlik Sense

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

Announcements
QlikWorld 2023, a live, in-person thrill ride. Save \$400 before Dec 31st: REGISTER NOW!
cancel
Showing results for
Did you mean:
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!

5 Replies
Contributor III

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

MVP

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)])

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.

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.
Contributor III
Author

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

Tags
Community Browser