Qlik Community

Ask a Question

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Talk to Experts Tuesday, January 26th at 10AM EST: Qlik Sense. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Contributor III
Contributor III

YTD Month Chart

Dear Sirs

I would have a straight chart with Month as dimension that shows the situation of sales at a selected number of day of the various months of this year compared of the same number of the day and month of the past year. At this stage I have this chart, that shows the comparison of months not up to the day 22 but up to the end of the month. Only last month is correct, because it is not completed.

I have used this two expressions:

=SUM({<[Year Ord.]={'$(VMaxYearOrd)'},[Date ord.]={'<=$(VMaxDataOrd.)'},[Month Ord.]=,[Day Ord.]=,MonthYearOrd.=>}Value)

and

=SUM({<[Year Ord.]={'$(VPriorYearOrd.)'},[Month Ord.]=,[Day Ord.]=,[Date ord.]={'<=$(VPriorYearDate)'},MonthYearOrd=>}Importo)

Thank you for your help.

BR

Andrea

1 Solution

Accepted Solutions
Partner
Partner

try replacing:

[Day Ord.]=               with     [Day Ord.]={"<=$(=day(today()))"}

View solution in original post

7 Replies
Partner
Partner

Try this:

current year:

SUM({<[Year Ord.]={'$(VMaxYearOrd)'},[Date ord.]=,[Month Ord.]=,[Day Ord.]={"<=$(=max([Day Ord.]))"}, MonthYearOrd.=>}Value)


last year:

SUM({<[Year Ord.]={'$(VPriorYearOrd)'},[Date ord.]=,[Month Ord.]=,[Day Ord.]={"<=$(=max([Day Ord.]))"}, MonthYearOrd.=>}Value)


Hope this helps

Regards!

Partner
Partner

try replacing:

[Day Ord.]=               with     [Day Ord.]={"<=$(=day(today()))"}

View solution in original post

MVP & Luminary
MVP & Luminary

Hi,

In script arrive a new column for day like below

Now use below expression

=SUM({<[Year Ord.]={'$(VPriorYearOrd.)'},[Month Ord.]=,[Day Ord.]={"<=$(=day(today()))"},

[Date ord.]={'<=$(VPriorYearDate)'},MonthYearOrd=>}Importo)


or if this not works then try below


LOAD

*,

Day(DateFieldName) AS Day

FROM DataSource;

=SUM({<[Year Ord.]={'$(=VPriorYearOrd.)'},[Month Ord.]=,[Day Ord.]=, Day={'<=$(=Day(Today()))'},

[Date ord.]={'<=$(=VPriorYearDate)'},MonthYearOrd=>}Importo)


Hope this helps you.


Regards,

Jagan.

Contributor III
Contributor III

Dear Alberto,

many thanks for your helpful answer.

How can I change the formula with a Varabile?

For example from [Day Ord.]={"<=$(=day(today()))"} to [Day Ord.]={"<=$(=day(VMaxDataOrd.)"}

Best regards

Partner
Partner

[Day Ord.]={"<=$(=day($(VMaxDataOrd.)))"}

Contributor III
Contributor III

Thank you Alberto!

I have found another solution, I have created a new variabile for the selection of the day.

best regards

Andrea