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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set analysis with date limitation

Hi,

I had a working set analysis expression that limited the date from the start of the fiscal year until today:

sum({$<Abschlusstermin.P= {">=$(=date('$(vFYStart)'),'YYYYMM')<=$(=date('$(vToday)'),'YYYYMM')"}>} [TCV Reportet (Produkt).P])

After a while and several changes to the scripts and the front end, I figured out that the limitation is not working anymore, so it shows all TCV values, not only from FY start to today.

Not sure if this is related to this change: the format for 'Abschlusstermin.P' in the load from was 'YYYYMM', now it's 'MM/YYYY'. I changed the expression to be

sum({$<Abschlusstermin.P= {">=$(=date('$(vFYStart)'),'MM/YYYY')<=$(=date('$(vToday)'),'MM/YYYY')"}>} [TCV Reportet (Produkt).P])


, but this won't work. Any ideas what is going wrong?



Thanks.

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Just an additional equal sign '=' would be required, like:

=sum({$<Abschlusstermin= {">=$(=date(vFYStart,'MM/YYYY'))<=$(=date(vToday, 'MM/YYYY'))"}>} TCV)

View solution in original post

14 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

In Script how you created this format 'MM/YYYY' using date() or combination of Month() and Year()?

Or go and check in the Table viewer, hover the field Abschlusstermin.P and check the tags associated to it whether its $numeric?

Not applicable
Author

In the script, i convert from old to new format:

date(date#(SF_TARGET.Monat,'YYYYMM'),'MM/YYYY') as Abschlusstermin.P

The table viewer states Key, Numeric, Integer, Timestamp, Date,

CELAMBARASAN
Partner - Champion
Partner - Champion

Try this

sum({$<Abschlusstermin.P= {">=$(=date(vFYStart,'MM/YYYY')<=$(=date(vToday, 'MM/YYYY')"}>} [TCV Reportet (Produkt).P])


it will work if vFYStart is created with proper date


Not applicable
Author

It is not working, even if I replace both variables with '01.04.2014' and '05.06.2014'.

CELAMBARASAN
Partner - Champion
Partner - Champion

sum({$<Abschlusstermin.P= {">='$(=date(vFYStart,'MM/YYYY')'<='$(=date(vToday, 'MM/YYYY')'"}>} [TCV Reportet (Produkt).P])


Upload your sample app to look in to this further

Not applicable
Author

Ok, I tried to create a simple one. Hope it helps.

tresesco
MVP
MVP

=sum({$<Abschlusstermin= {">=$(=date(vFYStart,'MM/YYYY'))<$(=date(vToday, 'MM/YYYY'))"}>} TCV)

Not applicable
Author

This is really close to what I'm looking for, thanks a lot.

I also have target values to calculate the same way, problem is for the year-to-date I would need to add the current month, currently only the last two months are calculated.

And for the expression above with the TCV, I also need to calculate to the current day.

How can I do this?

Thanks again.

tresesco
MVP
MVP

Just an additional equal sign '=' would be required, like:

=sum({$<Abschlusstermin= {">=$(=date(vFYStart,'MM/YYYY'))<=$(=date(vToday, 'MM/YYYY'))"}>} TCV)