Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
abhaysingh
Specialist II
Specialist II

Logic Help..

Hi,

pls see the below logic..

if(TaskStatusNum='1' or TaskStatusNum='2',

  count({<DateSubmitted={'>=$(=vStartDate)<=$(=vEndDate)'},IntervalType = {'2'}>}SurveyTaskId),

if(TaskStatusNum='3',

  count({<DateDueGracePeriod={'>=$(=vStartDate)<=$(=vEndDate)'},IntervalType={'2'}>}SurveyTaskId)))

in this when i select StartDate and End Date it works fine and data come...

Now i want in this same logic when StartDate and End Date not Selected It should give me some default value of current week like

DateSubmitted >= Weekstart(today())

&

DateDueGracePeriod >= Weekstart(today())


How i can achieve that?


thanks

5 Replies
senpradip007
Specialist III
Specialist III

Can you share your application along with some sample data?

jonathandienst
Partner - Champion III
Partner - Champion III

You need to provide more information if you want useful help. What is the context of the expression? If it is a chart/table, what are the dimensions? How are the dimensions associated with the fields in the expression? Are TaskStatusNum, StartDate and EndDate variables or fields? Are StartDate and EndDate fields? How do they associate with the expressions?

If you post your qvw or a representative sample, all these questions will be answered...

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
abhaysingh
Specialist II
Specialist II
Author

Hi Jonathan,

Sorry to post less info..

TaskStatusNum is a flag which says 1= Completed on time, 2= Subimtted late, 3= overdue


vStartDate and vEndDate are Variable which contain the field Start_Date and End_Date in it.


and Dimension is TaskStatus, flagging given to TaskStatusNum.


As a Chart, need to show Pie Chart. this all are in one table.. only concern is Date range selection for two different date in one expression.. as i asked above..


Pls let me know if any query..

thanks

Aby

Anonymous
Not applicable

Hi,

May be write another 'if' like

if(getselectedcount(yourdatefield)=0, write your condition for this:

DateSubmitted >= Weekstart(today())

&

DateDueGracePeriod >= Weekstart(today())

else

the current if you have mentioned in the post


I am not absolutely sure of this as the post is a bit hazy.


HTH

NRC

sasikanth
Master
Master

HI,

what about vStart_date and vEnd_Date,

Try to Give min(Start_Date) and max(End_Date) in the expression because variable can hold single value.