Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

YTD MTD

Hi to all,

(sum({<BILLDETAILENTRYTYPE = {'B'}, BILLCANCELLED = {'N'}, BILLESTIMATE = {'N'}>}BILLDETAILGROSSWEIGHT)/WeightFlag)
-
(sum({<BILLDETAILENTRYTYPE = {'R'}, BILLCANCELLED = {'N'}, BILLESTIMATE = {'N'}>}BILLDETAILGROSSWEIGHT)/WeightFlag)
-
(sum({<BILLDETAILENTRYTYPE = {'O'}, BILLCANCELLED = {'N'}, BILLESTIMATE = {'N'}, URDPURCHASE = {'Y'}>}BILLDETAILGROSSWEIGHT)/WeightFlag)

I taken label name as " Gross Weight" for above expression...please help me

I want find out YTD,MTD& WTD for above Expression.

How can I do???

Please help me out this issue.

Thanks in Advance.

regards

Chandra.

23 Replies
jagan
Luminary Alumni
Luminary Alumni

Hi,

If you have a date field then use below expression

YTD:

(sum({<Date={'>=$(=YearStart(Today()))<=$(=Today())'}, BILLDETAILENTRYTYPE = {'B'}, BILLCANCELLED = {'N'}, BILLESTIMATE = {'N'}>}BILLDETAILGROSSWEIGHT)/WeightFlag)

-

(sum({<Date={'>=$(=YearStart(Today()))<=$(=Today())'}, BILLDETAILENTRYTYPE = {'R'}, BILLCANCELLED = {'N'}, BILLESTIMATE = {'N'}>}BILLDETAILGROSSWEIGHT)/WeightFlag)

-

(sum({<Date={'>=$(=YearStart(Today()))<=$(=Today())'}, BILLDETAILENTRYTYPE = {'O'}, BILLCANCELLED = {'N'}, BILLESTIMATE = {'N'}, URDPURCHASE = {'Y'}>}BILLDETAILGROSSWEIGHT)/WeightFlag)


MTD:

(sum({<Date={'>=$(=MonthStart(Today()))<=$(=Today())'}, BILLDETAILENTRYTYPE = {'B'}, BILLCANCELLED = {'N'}, BILLESTIMATE = {'N'}>}BILLDETAILGROSSWEIGHT)/WeightFlag)

-

(sum({<Date={'>=$(=MonthStart(Today()))<=$(=Today())'}, BILLDETAILENTRYTYPE = {'R'}, BILLCANCELLED = {'N'}, BILLESTIMATE = {'N'}>}BILLDETAILGROSSWEIGHT)/WeightFlag)

-

(sum({<Date={'>=$(=MonthStart(Today()))<=$(=Today())'}, BILLDETAILENTRYTYPE = {'O'}, BILLCANCELLED = {'N'}, BILLESTIMATE = {'N'}, URDPURCHASE = {'Y'}>}BILLDETAILGROSSWEIGHT)/WeightFlag)


WTD:

(sum({<Date={'>=$(=WeekStart(Today()))<=$(=Today())'}, BILLDETAILENTRYTYPE = {'B'}, BILLCANCELLED = {'N'}, BILLESTIMATE = {'N'}>}BILLDETAILGROSSWEIGHT)/WeightFlag)

-

(sum({<Date={'>=$(=WeekStart(Today()))<=$(=Today())'}, BILLDETAILENTRYTYPE = {'R'}, BILLCANCELLED = {'N'}, BILLESTIMATE = {'N'}>}BILLDETAILGROSSWEIGHT)/WeightFlag)

-

(sum({<Date={'>=$(=WeekStart(Today()))<=$(=Today())'}, BILLDETAILENTRYTYPE = {'O'}, BILLCANCELLED = {'N'}, BILLESTIMATE = {'N'}, URDPURCHASE = {'Y'}>}BILLDETAILGROSSWEIGHT)/WeightFlag)

Note: Replace Date with your actual field name.

Regards,

Jagan.

Not applicable
Author

Hi Jagan,

Thanks so much your reply.

it is great helpful for me.

if you dont mine give me like below...

I have Date field is "BillDate"

i have data from "01/04/2014" to 01/03/2015 (DD/MM/YYYY)

i have regions like AP,KARNATAKA

i have 7 regions

please give me complete expressions now

Thanks in advance.

Regards

chandra.

Not applicable
Author

hi,

What is the Today() here

please explain me

Thanks in Advance

jagan
Luminary Alumni
Luminary Alumni

Hi,

check this

YTD:

(sum({<BillDate={'>=$(=YearStart(Today()))<=$(=Today())'}, BILLDETAILENTRYTYPE = {'B'}, BILLCANCELLED = {'N'}, BILLESTIMATE = {'N'}>}BILLDETAILGROSSWEIGHT)/WeightFlag)

-

(sum({<BillDate={'>=$(=YearStart(Today()))<=$(=Today())'}, BILLDETAILENTRYTYPE = {'R'}, BILLCANCELLED = {'N'}, BILLESTIMATE = {'N'}>}BILLDETAILGROSSWEIGHT)/WeightFlag)

-

(sum({<BillDate={'>=$(=YearStart(Today()))<=$(=Today())'}, BILLDETAILENTRYTYPE = {'O'}, BILLCANCELLED = {'N'}, BILLESTIMATE = {'N'}, URDPURCHASE = {'Y'}>}BILLDETAILGROSSWEIGHT)/WeightFlag)


MTD:

(sum({<BillDate={'>=$(=MonthStart(Today()))<=$(=Today())'}, BILLDETAILENTRYTYPE = {'B'}, BILLCANCELLED = {'N'}, BILLESTIMATE = {'N'}>}BILLDETAILGROSSWEIGHT)/WeightFlag)

-

(sum({<BillDate={'>=$(=MonthStart(Today()))<=$(=Today())'}, BILLDETAILENTRYTYPE = {'R'}, BILLCANCELLED = {'N'}, BILLESTIMATE = {'N'}>}BILLDETAILGROSSWEIGHT)/WeightFlag)

-

(sum({<BillDate={'>=$(=MonthStart(Today()))<=$(=Today())'}, BILLDETAILENTRYTYPE = {'O'}, BILLCANCELLED = {'N'}, BILLESTIMATE = {'N'}, URDPURCHASE = {'Y'}>}BILLDETAILGROSSWEIGHT)/WeightFlag)


WTD:

(sum({<BillDate={'>=$(=WeekStart(Today()))<=$(=Today())'}, BILLDETAILENTRYTYPE = {'B'}, BILLCANCELLED = {'N'}, BILLESTIMATE = {'N'}>}BILLDETAILGROSSWEIGHT)/WeightFlag)

-

(sum({<BillDate={'>=$(=WeekStart(Today()))<=$(=Today())'}, BILLDETAILENTRYTYPE = {'R'}, BILLCANCELLED = {'N'}, BILLESTIMATE = {'N'}>}BILLDETAILGROSSWEIGHT)/WeightFlag)

-

(sum({<BillDate={'>=$(=WeekStart(Today()))<=$(=Today())'}, BILLDETAILENTRYTYPE = {'O'}, BILLCANCELLED = {'N'}, BILLESTIMATE = {'N'}, URDPURCHASE = {'Y'}>}BILLDETAILGROSSWEIGHT)/WeightFlag)


Today() gives the current date i,e, today's date.


YTD means - Current year uptodate i,e, 1-Jan-2015 to till date (16-Feb-2015)

Regards,

Jagan.

Not applicable
Author

Hi Jagan,

I am trying what you given expressions but i am getting same values for YTD,MTD AND WTD,

So where can i done mistake???

jagan
Luminary Alumni
Luminary Alumni

Hi,

I think your data is same for MTD, WTD and MTD.  YTD expression works for the current year.

Regards,

Jagan.

Not applicable
Author

hi Jagan,

wtd and mtd same in the sense i cant get that word??

Please explain me

thanks

jagan
Luminary Alumni
Luminary Alumni

Hi,

What value you are getting for YTD, MTD and WTD?

Can you attach some sample data and your expected ouput, so that it would be easier to give solution.

Regards,

Jagan.

Not applicable
Author

Hi jagan,

YTD is getting currect values but i m not getting currect values for MTD & WTD,

I used what you given those expressions only i  used

thanks for consideration of my requests