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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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? 

Labels (1)
24 Replies
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)


shiveshsingh
Master
Master

Can you try this?

Anil_Babu_Samineni
MVP
MVP

Does this helps?

Capture.PNG

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
PunamWagh
Contributor III
Contributor III

if you want to show the days as Day 1, Day2...

then use this as a dimension-

Pick(match(Weekday,'Mon','Tue','Wed','Thu','Fri','Sat'),'Day1','Day2','Day3','Day4','Day5','Day6')

MarcoWedel
MVP
MVP

In this case please close your other thread.

thanks

regards

Marco