Skip to main content

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Action-Packed Learning Awaits! QlikWorld 2023. April 17 - 20 in Las Vegas: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Can anyone help me with the issue, Previous Year To Date

Hi,

My job is to obtain sum of Ordered_Quantity for "Present Year-to-date and Previous Year-To-Date" for one selection using straight chart, by taking Sold_to_org_id as dimension and I have used expressions to obtain Present Year-To-Date and Previous Year-To_Date.

I have created Year, Month and Day using Inline Load and used these values for selection.

I have succeeded in getting the output for Present Year-To-Date by using expression,

Sum({<Year=, Month=, Day=, DateNum={">=$(=Num(YearStart(Max(DateNum))))<=$(=Max(DateNum))"}>} OE_ORDER_LINES_ALL.ORDERED_QUANTITY)

Where Datenum = (Floor(orderdate))

I am having issue with Previous Year_To-Date. I have tried all, the expressions I Knew and got from blogs, but still it is displaying zero's.

Can anyone help me in obtaining the sum of Ordered_Quantity for  Present Year_To-Date as well as Previous Year_To-Date using one selection of Year,  Month and Date.

Thanks & Regards,

Varun.

1 Reply
Not applicable
Author

Hi,

Try this expression:

(Sum({$<DateNum={"<=$(=Max(DateNum))"}, Year={"$(=Max(Year))"}, Year=, Month=, Day=>}[OE_ORDER_LINES_ALL.ORDERED_QUANTITY]) /

Sum({$<DateNum={"<=$(=Max(DateNum)-12)"},

Year={"$(=Max(Year)-1)"},Year=,Month=,Day=>}[OE_ORDER_LINES_ALL.ORDERED_QUANTITY]))-1