Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
I have a master Calendar setup on my dashboard
I need to find the number of days (Monday - Sunday) currently selected on the master calendar in order to use it as part of an expression.
LOAD
WeekDay([SHIP DT]) as DOW,
[SHIP DT],
[SHIP DT] as ship_dt,
fiscal_year,
fiscal_week,
fiscal_month,
fiscal_qtr,
monthyr,
quarteryr,
weekyr,
budget_wk
Hi,
on the front end, you can do this:
Max([SHIP DT]) - Min ([SHIP DT])
and when you have selections made, you can add this:
Max({1} [SHIP DT]) - Min ({1} [SHIP DT])
Hi John,
Probably you need this GetSelectedCount(DOW)
When you make selection in DOW field it brings you number of selected days.
Would be nice to get feedback from you.
Youssef,
I relatively new to Qlikview when you say on the "front end" are you referring to putting the formula in the Master Calendar Script?
Max,
Thanks but this didn't give me the total calendar days for the time period I selected.
John,
Would you clarify a meaning of calendar days for your project?
Is it week days or days from 1 to 31?
Please provide print screen what are you trying to get.
Hi John,
Back end it is the SCRIPT, Front end is the visualisation part.
the solution i gave you, you can try it on the Front end, on "text box" object for example.
Max,
Hi, to answer your question it is the number of days from 1 to 31
John, you need to supply more than just what you've given us. Is your calendar joined to your data by ship_dt (or other)? What are your selections? Are you counting calendar days or data days? Please provide more info on the nature of your data model and what you expect to get. Perhaps some sample data? Please help up help you.
Regards,
John
John,
I have two tables a master calendar and a sales table. The sales are based on ship dates Mon - Saturday. The master calendar includes all days of the week...the issue is we do not have any sales on Sunday (no ship dates) so I'm only able to count 6 days using the solution that Youssef gave me.
Now I need a solution to count the number of calendar days (Mon - Sun) for the same time period.
Thanks,
JW