Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
paulyeo11
Master
Master

SET analysis don't need select month and year

Hi All

Below are the script working fine , but hope some one can help me modify the below script , so that i don't require to select month = 9 , year = 2015 , meaning i want the script automatic give me the value , as i want to apply the script in QS.

money(

sum({$<year = {$(=max(year)-0)}

,[Reporting Code] = {

">=00001<=

00019"

     }

, month = {"<=$(=max({<year={$(=max(year))}>} month))"}>} Amount/$(ColumnDim98))/1000

, $(vMoneyFormatK_GL))

5 Replies
Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,

I don't really understand what you want to achieve here.

But reading this blog might help Dates in Set Analysis and post a sample data

Anonymous
Not applicable

try this, it gives you the values only from 9/2015.

if month is not a number but text (Sep) you Need to Change to month={'Sep'}

money(

sum({$<year = {2015}

,[Reporting Code] = {

">=00001<=

00019"

     }

, month = {9}>} Amount/$(ColumnDim98))/1000

, $(vMoneyFormatK_GL))

paulyeo11
Master
Master
Author

Hi Sir

Thank you for your sharing.

What I need is it will alway display YTD sales , so I don't need to keep change the expression every month. And it will auto display YTD amount.

Paul

PT TDS Technology | Ruko Celebration Boulevard, Blok AA9 No. 63, Grand Wisata | Tambun-Bekasi-West Java 17510 | Mobile: +62 858 8352 1036 | Phone & Fax: +62 21 82615966 | Website: www.tdstech.com

jagan
Luminary Alumni
Luminary Alumni

Hi Paul,

Check this expressions for YTD and other set analysis expressions

Set Analysis for certain Point in Time

Set Analysis for Rolling Periods

If you have a date filed then you can try like this

Money(

sum({$<year = ,[Reporting Code] = {">=00001<=00019"}, month =, datefieldName={‘>=$(=YearStart(Today()))<=$(=Today())’} >} Amount/$(ColumnDim98))/1000

Note: Replace datefieldName with your actual field name in the above expression.

Regards,

Jagan.

Not applicable

Hi

If you have a field in your data set with the whole data, you could use YearToDate function to get the set of records fot YTD calculation

Cheers

OR