Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
soniasweety
Master
Master

Current week

Hi all,

I want to display the dimension as  current week  like below

My date field is   Tran_Date

Day1

Day2

Day3

Day4

Day5

Day6       this is current week except sunday

how can I write the calculation condition? 

1 Solution

Accepted Solutions
PunamWagh
Contributor III
Contributor III

Try this,

Backend

Temp:

Load * inline [

Date, ID

6/1/2018,2

6/2/2018,2

5/31/2018,2

5/30/2018,2

5/29/2018,2

5/28/2018,2

5/27/2018,2

5/26/2018,2

5/25/2018,2

5/24/2018,2

];

NoConcatenate

load *,

     weekday(Date) as Weekday,

     num(Date)as Numdate,

     if(weekday(Date) = 'Sun',0,1) as sunday_flag

Resident Temp;

drop table Temp;



exit script;


frontend


char dimension as Weekday

expression as-


Count({<Numdate = {">=$(=num(WeekStart(Max(Numdate),0)))<=$(=max(Numdate))"}, sunday_flag = {'1'}>}ID)


View solution in original post

24 Replies
prat1507
Specialist
Specialist

Hi

Can you plz elaborate a bit.


Regards
Pratyush

soniasweety
Master
Master
Author

hi

I want to show the bar chart  for current weekdays excluding sunday  with the attached format

   so how to achieve this?

dim= Tran_Date

measure= count(id)Dim-day.PNG

prat1507
Specialist
Specialist

hi

You can exclude the dimension using this

=if(date(DateField,'WWWW')<>'Sunday',

pick(match(date(DateField,'WWWW'),'Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'),

'Day1','Day2','Day3','Day4','Day5','Day6')



Regards

Pratyush

soniasweety
Master
Master
Author

Hi ,

thanks for reply. but   I need to show current week only

now your expression is showing to over all I think?

or else can I restrict current week in measure?    then how can I  ?

count(Id)

soniasweety
Master
Master
Author

Hi sunny

any idea

Sunny Talwar

shiveshsingh
Master
Master

You can use the max week values in your expression..can you try this?

count({<Week = {"$(=Max(Week))"}>}ID)

MarcoWedel

Is there any particular reason for not continuing this question in your thread Display name ?

soniasweety
Master
Master
Author

‌if I use this I vill get including Sunday also?

i Want to exclude Sunday in this

soniasweety
Master
Master
Author

yyes that was different and now logic got changed by cliebt‌