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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anil_Babu_Samineni
MVP
MVP

YTD Calculation

Dear Friends,

I am trying to create one Pivot table. Here, i want to calculate Week and YTD using My Date field with the calculation

For Week Calculation, I am using this

=sum({<C_DESCRIPTION={'Reportable','Recordable','Restricted work Cases','Lost Work Cases'} >} S_COUNT)

For Year Calculation, I am using this

Sum({<Year=, Month=, Quarter=, Week=, DateField=, DateNum={">=$(=Num(YearStart(Max(DateNum))))<=$(=Max(DateNum))"}>} S_COUNT)

My Master Calendar is

MinMaxDate:

Load

  //Num(Yearstart(Min(S_CREATED_DATE))) as MinDate,

  Num(Min(S_CREATED_DATE)) as MinDate,

  Num(Max(S_CREATED_DATE)) as MaxDate

  Resident Facts;

Let vMinDate = Peek('MinDate',0,'MinMaxDate');

Let vMaxDate = Peek('MaxDate',0,'MinMaxDate');

Drop Table MinMaxDate;

Temp_calendar:

load $(vMinDate) + Recno() - 1 as Date autogenerate $(vMaxDate)-$(vMinDate) +1;

Master_calender:

Load //MonthName(Date) as MonthYear,

  Date#(Date(Date),'DD-MM-YYYY') as Date,

  //time(date#( Date , 'YYYYMMDDhhmmss'), 'DD:MM"YYYY hh:mm:ss') as Date,

  Year(Date) as Year,

  Day(Date) as Day,

  Week(Date) as Week,

  Month(Date) as Month,

  'Q' & Ceil(month(Date)/3) as Quarter

Resident Temp_calendar;

drop Table Temp_calendar;

So, Now i am expecting only Week and Year Calculation using Sum(S_COUNT)

Please help me

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Labels (1)
16 Replies
sunny_talwar
MVP
MVP

That part is to force a 0 regardless of selection to those dimension values which are not selected. This happens because of {1} in there.

I also unchecked 'Suppress Zero-Values' on the presentation tab to show 0 values for those dimensions which are not selected.

Does this make sense?

Anil_Babu_Samineni
MVP
MVP
Author

So, Here {1} is nothing but {Sales}

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anil_Babu_Samineni
MVP
MVP
Author

Sunny,

This scenario I want to highlet whole we click the year

So, I want to click the year I want to highlet for selection left all need to see hidden graphs.

But, I want to show whole data. Like attachment

Cab you please help me this.IMG-20160715-WA0000.jpg

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sunny_talwar
MVP
MVP

Do you mean Year or City? What is your current expression?

Anil_Babu_Samineni
MVP
MVP
Author

That image is for sample. So, you already shared me that application I want to show sales by year selection.

Please send me the expression

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sunny_talwar
MVP
MVP

What expression Anil, I am not sure what you mean my friend

Anil_Babu_Samineni
MVP
MVP
Author

Sunny,

You shared me one application before right

In that, my client want to show all year data then once we click the year I want to highlight that selection year. Remaining graphs are hidden.

Did you understand my question. Please check before conversation

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful