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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Karim_Khan
Creator III
Creator III

How to get the Quarterly data calculation in set expression

I am applying the below code

=sum({<FiscalYear={'$(vPriorYear)'},FiscalQuarter={'$(vQuarter)'}>}[Net Bookings])

this is working fine for first month calculation of particular quarter.But while selecting the last or middle month of any quarter then calculation is showing wrong value

Regards,

K K

KK
3 Replies
ramoncova06
Partner - Specialist III
Partner - Specialist III

can you upload some sample data, since you are using variables we cannot tell what values are they bringing

Karim_Khan
Creator III
Creator III
Author

SET ThousandSep=',';

SET DecimalSep='.';

SET MoneyThousandSep=',';

SET MoneyDecimalSep='.';

SET MoneyFormat='Rs. #,##0.00;Rs. -#,##0.00';

SET TimeFormat='hh:mm:ss';

SET DateFormat='DD-MM-YYYY';

SET TimestampFormat='DD-MM-YYYY hh:mm:ss[.fff]';

SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';

SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';

Cisco:

LOAD [End Customer Global Ultimate Name],

     Country,

     [End Customer HQ Top],

     [Sales Level 1],

     [Sales Level 2],

     [Sales Level 3],

     [Sales Level 4],

     [Sales Level 5],

     [Partner Name],

     [Fiscal Period ID],

    Year(date#([Fiscal Period ID],'YYYYMM')) as FiscalYear,

    num(month(date#([Fiscal Period ID],'YYYYMM'))) as FiscalMonthNum,

    month(date#([Fiscal Period ID],'YYYYMM')) as FiscalMonth,

    Day(date#([Fiscal Period ID],'YYYYMM')) as FiscalDay,

    Date(date#([Fiscal Period ID],'YYYYMM'),'DD-MM-YYYY') as Date,

     FMV,

     [Net Bookings],

     Group

FROM

[\\arlmssan02\cm$\tp_managers\DBMIGrp\9. Team Members Folders\Karim\Assign_Project\Nikhil.G\CISCO\Copy of June raw.xlsx]

(ooxml, embedded labels, table is Sheet1);

Left Join (Cisco)

LOAD * Inline [

FiscalMonthNum,CalenderMonth, CaldenderMonthNum,FiscalQuarter

1,Aug,8,Q1

2,Sep,9,Q1

3,Oct,10,Q1

4,Nov,11,Q2

5,Dec,12,Q2

6,Jan,1,Q2

7,Feb,2,Q3

8,Mar,3,Q3

9,Apr,4,Q3

10,May,5,Q4

11,Jun,6,Q4

12,Jul,7,Q4 ];

//Final:

//LOAD *,

//monthname(Date#(CalenderYear&CalenderMonth,'YYYYMMM')) as CalenderMonthYear,

//date(Date#(CalenderYear&CalenderMonth,'YYYYMMM'),'DD-MM-YYYY') as Date;

//LOAD

//FiscalYear,

//FiscalMonthNum,

//CalenderMonth,

//[Fiscal Period ID],

//if(CaldenderMonthNum>=8,FiscalYear-1,FiscalYear) as CalenderYear

//Resident  Cisco;

//

//

//DROP Table Cisco;

KK
ramoncova06
Partner - Specialist III
Partner - Specialist III

your script looks ok, though I would suggest creating a master calendar

The Master Calendar

what is inside of your variables ?