Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
paulyeo11
Valued Contributor II

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
Valued Contributor II

Re: SET analysis don't need select month and year

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

hrlinder
Honored Contributor

Re: SET analysis don't need select month and year

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
Valued Contributor II

Re: SET analysis don't need select month and year

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

MVP
MVP

Re: SET analysis don't need select month and year

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

Re: SET analysis don't need select month and year

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

Community Browser