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

In what situation QV user still using YTD Flag and not using SET ?

Hi All

May i know the answer from QV developer ?

Or I re-phase the questions , what are the YTD Flag is not able replace by SET Analysis ?

The reasons i ask this question is because , if the answer of above is No , i like to know why YTD Flag is so powerfull which unable to replace by SET.

For example , in QS , i use YTD and not SET Analysis , because QS is not encourage user to click on month = current month and year = current year.

Paul

1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

HI,

Try this.

money(

Sum({<Year=, Quarter=, Month=, Date={'>=$(=YearStart(Today(), -1))<=$(=Addyears(monthend(Today()),-1))'}>} $(ColumnDim51)/1000)

, $(vMoneyFormatK))

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

17 Replies
jagan
Luminary Alumni
Luminary Alumni

HI,

YOu can achieve YTD without using Flags, set expression below

=Sum({<Year=, Quarter=, Month=, Date={'>=$(=YearStart(Today()))<=$(=Today())'}>} Sales)

Hope this helps you.

Regards,

jagan.

jagan
Luminary Alumni
Luminary Alumni

Hi,

Please check below link for similar type of expressions like QTD, MTD, YTD

Set Analysis for certain Point in Time

Regards,

Jagan.

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

Have a look at the link below.

Point-in-Time Reporting.qvw

Hope this helps to understand the difference.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
HirisH_V7
Master
Master

Hi,

I think its based on your data,

You can go with Set analysis, If your data is till today() will go with Set Analysis for certain Point in Time  With Today()

or Else,

we can use  Set Analysis for Rolling Periods with Max of your Date Fields.

In Similar way you can create a Flags like last 12 months data in your script like this,

    If(Date>= AddMonths(Today(), -12), 1)as Last12MonthFlag

You can use it set analysis like

Sum( {<Last12MonthFlag={1}>}Sales)

But for better results and Performance go with set analysis in Front end.

Hope this helps,
PFA,

Hirish

HirisH
“Aspire to Inspire before we Expire!”
paulyeo11
Master
Master
Author

Hi Jagon

Thank you for share with me below expression for CY :-

money(

Sum({<Year=, Quarter=, Month=, Date={'>=$(=YearStart(Today()))<=$(=Today())'}>} $(ColumnDim51)/1000)

, $(vMoneyFormatK))

I have try your expression on CY , may i know how to modify the below expression to LY ?

I have try below , but it does not work :-

money(

Sum({<Year=, Quarter=, Month=, Date={'>=$(=YearStart(Today()-1))<=$(=Today())'}>} $(ColumnDim51)/1000)

, $(vMoneyFormatK))

jagan
Luminary Alumni
Luminary Alumni

Hi Paul,

Try this

money(

Sum({<Year=, Quarter=, Month=, Date={'>=$(=YearStart(Today(), -1))<=$(=YearEnd(Today(), -1))'}>} $(ColumnDim51)/1000)

, $(vMoneyFormatK))

HirisH_V7
Master
Master

Hi ,

Check  this,

If your are comparing between Years,

PFA,

Hirish

HirisH
“Aspire to Inspire before we Expire!”
paulyeo11
Master
Master
Author

it should be 148 but display 802 , which is wrong

jagan
Luminary Alumni
Luminary Alumni

Hi,

Not sure, but the expression is correct.  Check the date format of Today() & Date field.  If you attach sample file it would be easier to find.

Regards,

jagan.