Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Show Week Ending Date

Hi all,

I am currently trying to have a chart title show the week ending date whenever a Financial Week is selected. With the data I have, I have to do this by selecting the highest day (DAY_DT) of the selected week (FINANCIAL_WEEK). The code I have written so far is:

If(GetSelectedCount(FINANCIAL_WEEK) >= 1, 'Wk Ending ' & ...

And this is where I am stuck. I have tried combinations with FirstSortedValue but nothing seems to work, and it just returns "Wk Ending " when a week is selected. Any suggestions?

Tags (2)
1 Solution

Accepted Solutions
jpe
Not applicable

Re: Show Week Ending Date

Is DAY_DT a date field or numerical field ?  Please share the data format. If its a date this may work:


If(GetSelectedCount(FINANCIAL_WEEK) >= 1, 'Wk Ending ' &  max(date(DAY_DT)) )


Otherwise please share the data format of the values as they appear in  a list box.

4 Replies
jpe
Not applicable

Re: Show Week Ending Date

Is DAY_DT a date field or numerical field ?  Please share the data format. If its a date this may work:


If(GetSelectedCount(FINANCIAL_WEEK) >= 1, 'Wk Ending ' &  max(date(DAY_DT)) )


Otherwise please share the data format of the values as they appear in  a list box.

Not applicable

Re: Show Week Ending Date

You can use Weekend() function which gives you Sunday. If you want Friday as the weekend date then you can use "date(weekend(today())-2)". Hope this helps.

Thanks

Not applicable

Re: Show Week Ending Date

instead of 'Wk Ending ' try Max(Day_DT)

Thanks

Suraj

Not applicable

Re: Show Week Ending Date

This worked perfectly. I think I was trying to get too complicated. Thanks for the quick response!