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

How load only a particular day of week

Dear all,

I have a question:

1. I have a table that contains my daily balances. I need to create a chart giving the balance for each friday of week.

My idea is to load from database only those records where the date is a friday.

Is there any way to do this chart without to have a different select and have in the same app the possibility to view the balance and a chart that shows only the records where the date is a friday?

Thank you

1 Solution

Accepted Solutions
rustyfishbones
Master II
Master II

Hi Massimo,

Do you have Weekday in your Calendar?

create weekday by adding it in your script

WeekDay([DATE_REF]) AS Weekday

And then use the Expression

SUM({<Weekday ={'Fri'}>}BALANCE_CVT2).

View solution in original post

13 Replies
rustyfishbones
Master II
Master II

Yes if you have Date as your dimension you could say for your expression

SUM({<Weekday ={'Fri'}>}Amount)

sunny_talwar

Update: Misread the question. I think you would be able to use the above expression to do the job for you. Just have a column name Weekday in your script (most likely within your Master Calendar (WeekDay(Date) as Weekday)

TempTable:

LOAD Date,

          yourOtherColumns

FROM xyz.xlsx;

Table:

NoConcatenate

LOAD *

Resident TempTable

Where WeekDay(Date) = 'Fri';

DROP Table TempTable;

Hope this helps.

Best,

S

Anonymous
Not applicable
Author

Not sure what you exactly want to show in the chart

I would define a dimension with weekend(date, 0, -2) which gives you friday as date

then your expression should only sum for the fridays

Not applicable
Author

Dear Alan,

many thanks for your reply.

I have used the date into the dimension als as follow =(weekend([DATE_REF], 0, -2) ) and see the chart with only the fridays.

But using your suggestion to calculate the sum of only records having the sum only of friday records it doesn't work.

The expression is: SUM({<Weekday ={'Fri'}>}BALANCE_CVT2).

Any suggestion?

Thank you

Not applicable
Author

Dear Sunidia,

i would like to have just one app that could give usrs way to determine the balance to a certain date and at same time to see the chart by all fridays of week. May I add to the same load of all records an additional load as for your example and use two different load in the same app?

Thank you

Not applicable
Author

Dear Rudolf,

yes it works for the dimension but the SUM is forr all records of the week. Any ideas on how to say to sumn only those records where the date is a friday?

thank you

rustyfishbones
Master II
Master II

Hi Massimo,

Do you have Weekday in your Calendar?

create weekday by adding it in your script

WeekDay([DATE_REF]) AS Weekday

And then use the Expression

SUM({<Weekday ={'Fri'}>}BALANCE_CVT2).

Not applicable
Author

Hi Massimo,

could you please attach a file?


Not applicable
Author

Hi Alan it works perfectly! Thank you