Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
andyrebs
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
albertovarela
Partner - Specialist
Partner - Specialist

try replacing:

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

View solution in original post

7 Replies
gmoraleswit
Partner - Creator II
Partner - Creator II

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!

albertovarela
Partner - Specialist
Partner - Specialist

try replacing:

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

jagan
Luminary Alumni
Luminary Alumni

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.

andyrebs
Contributor III
Contributor III
Author

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

albertovarela
Partner - Specialist
Partner - Specialist

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

andyrebs
Contributor III
Contributor III
Author

Thank you Alberto!

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

best regards

Andrea